iTP Active Transaction Pages (iTP ATP) Programmer's Guide
ATP Objects, Properties, and Methods
iTP Active Transaction Pages (iTP ATP) Programmer’s Guide—522292-002
4-13
Sample Application
•
ATP_HTTP_CREATE_FAILED(101): Internal socket error. Check errorDetail value
for Guardian system error message.
•
ATP_HTTP_CONNECT_FAILED(102): Internal socket error. Check errorDetail
value for Guardian system error message.
•
ATP_HTTP_SEND_FAILED(103): Internal socket error. Check errorDetail value
for Guardian system error message.
•
ATP_HTTP_READ_FAILED(104): Internal socket error. Check errorDetail value
for Guardian system error message.
•
ATP_HTTP_HEADER_INVALID(200): Invalid request/response header.
•
ATP_HTTP_HEADER_TOO_LONG(202): Internal error. The HTTP request header
is too long.
Sample Application
The following sample application shows how to get the default home page from
www.yahoo.com. You should modify proxy information according to your own network
configurations.
<server>
try
{
var http = new Inet.HTTP;
http.url = "http://www.yahoo.com/"
http.setProxyInfo("proxy.tandem.com", 8080);
http.GET();
}
catch (e)
{
println("!!! HTTP Exception: !!!");
println("code: " + e.code);
println("detail: " + e.detail);
println("description: " + e.description);
println("method: " + e.method);
println("module: " + e.module);
println("");
}
// print all response header fields.
headers = http.responseHeaderNames;
for (i=0; i<headers.length; i++)
{
println(headers[i] + ": " + http.getResponseHeader(headers[i]));
}
println("status: " + http.status);
println("statusText: " + http.statusText);
var body = http.responseText;
println(http.responseText);
</server>