Alertra Script Language 1.9

http

Makes an HTTP connection to the computer using the computer identified in the last dns and tcp commands.

If you use the 'GET' method, you can pass form variables in the 'request' parameter or by using the form or formdata commands. However, the 'POST' method requires that you use form or formdata to pass form variables.

You must specify one of 'get', 'head', or 'post' in the options parameter.

If you are posting form data you should usually include the 'encode' option. This will translate illegal characters in your form variables into hex characters acceptable in the HTTP protocol. The only reason not to use this option is if in setting the form variables you have manually translated the illegal characters already.

usage: http [options] [request] [user] [pass]

parameters:

req name type description
Y options list Comma separated list of options for the HTTP connection. Available options are:
  • head Retrieve only the HTTP header records.
  • get Use the 'GET' method of making the request.
  • post Use the 'POST' method of making the request.
  • redir Instructs the 'http' command to follow redirection commands to subsequent pages.
  • encode Converts form values to standard application/x-www-form-urlencoded format
Y request expression The page request sent to the HTTP server.
N user expression If the server requests authentication, the user to use to authenticate.
N pass expression The password for the user in authentication.

examples

http get,redir "/index.html"

Retrieves the page "/index.html" from the server using the 'GET' method. The 'http' command will follow all redirect commands from the server (redirect loop protection is built into ASL; the script will end with an error if a redirect loop is detected).

http post,encode "/scripts/checkcc.asp" "joe" "u571"

Posts whatever variables have been set with either the form or formdata commands to the "/scripts/checkcc.asp" page. If the variables were set with the form command, then they will also be encoded. If the server requests authentication information, it will be sent the user "joe" with the password "u571".


Alertra Script Language: Language Reference