![]() |
![]() ![]() |
||
|
|||
Overview |
X-Tract can also make its own calls to remote web-servers, using the _socket command. This example describes how to use _socket to implement HTTP, but the command can be used for any remote, port-based, operation. |
||
HTTP headers |
These two schematics show the most basic HTTP headers that might be
used to pass CGI information onto a remote server, or, with an empty
query string, just request an HTML file (note that both
_eval and _data both already support calling
a URL using HTTP, if you wish to load a remote file into your
template's environment). The full HTTP specification is available at
the W3C site: to comply
with the HyperText Transfer Protocol, a POST request requires a
|
||
Opening a socket |
If the above is plain-text content of the object http_header on the data side, including the two return characters (non-obvious in the GET case!) then we can open a socket and connect thus:
|
||
Notes |
The above code reads the incoming HTTP-Response (which is generally
unencoded, but conforms to various standards as regards the scope of
the ASCII that can be included) and puts it into a
|
||
Tip |
For further documentation of socket calls, see the ICE-X package and its associated documentation. |
||
Contents... | |||
XML Script homepage | Documentation home | XML Script docs | Command list | Function list | X-Tract docs X-Stream, X-Tract and XML Script are trade marks of DecisionSoft Limited© Copyright 1998-2000 DecisionSoft Limited |