
httppost <url>,
Sends data to a web server across the interent and downloads (fetches) the reply into a file. This command effectively performs an HTTP POST operation.
A successful URL retrieval will set the system numeric found to 1. An error will set it to 0.
Note: If the web-server from which the download is being made has authorization checks involving the completion of a web-page, e.g. a login page, then this will not be processed like a browser. Such cases will have the effect of merely downloading the login page, instead of the requested file.
<url>
The URL (Universal Resource Locator) of the file to be fetched. This can
be a string expression, a string constant within quotes or straight text.
If the text contains characters not usually permitted within file names,
the text should be quoted. The prefix 'http:' may be omitted.
<datafile>
The name of a local file (or blob) whose data is to be sent.
<file>
The name of the local file to be created or overwritten. If the file name contains a directory
path, sub-directories will be created automatically where necessary.
<dir>
A directory into which the file will be copied. The local file name will be the trailing file
name part of <url>.
This directory must already exist. If neither <file> nor
<dir> are specified a local
file is created in the current directory. The local file name will be
the trailing file name part of <url>.
-os=<ident>
Record the returned http packet header contents in a string identifier.
If the identifier does not exist, a new string array is created using current
scope rules. Each line of the header is recorded in a separate array element.
-tim=<num>
Set a timeout (in seconds) on the operation. The default is 30 seconds.
-ty=<string>
Text to add to the outgoing http header to specify the type of data in <datafile>.
The header prefix "Contents-Type:" should not be present because
it will be added automatically.
-z
Decompress the file if it is in gzip format. If <file> is omitted, then the
name of the local file is provided by the gzipped data. If the file is
in gzip format but the -z switch is not present,
no uncompresion is done.
Upload a data file myfile.xml to a web servlet. The returned data will be stored in a local file result.xml. Time out after 10 seconds wait.
httppost //remotenode/MyServlet, myfile.xml, result.xml, -tim=10, -ty='text/xml'
Do the same (without the timeout) and record the returned http header information.
string header[] ;# Not strictly necessary httppost //remotenode/MyServlet, myfile.xml, result.xml, -ty='text/xml', -os=header
Commands: