| Syntax |
tcp.httpClient (method, server, port, path, proxy, proxyPort, proxyUserName, proxyPassword, data, datatype, username, password, adrHdrTable, cookiesOn, debug, timeOutTicks, flMessages, ctFollowRedirects)
|
| Params |
method, a string. is the HTTP method to be used, e.g. "GET" or "POST"
server, a string. is the address of the server, either a domain name or a dotted id, e.g. "www.scripting.com" or "206.204.24.4"
port is a number, usually 80, that the HTTP server is accessed thru
path, a string, is the URL of the file being requested, e.g. "/default.html"
proxy, proxyPort, proxyUserName, proxyPassword, all strings, allow you to talk to a proxy server
data, a string, is the data to be sent in the body of the request
datatype, a string, is the Content-type of the message header
username, password, both strings, allow you to access password-protected pages
adrHdrTable, an address, can contain additional header items for the HTTP request
cookiesOn, a boolean, indicates whether or not you want to exchange a cookie with the server
debug, a boolean, if true, tcp.httpClient will save the request and response in scratchpad.httpCommand and scratchpad.httpResult.
timeOutTicks, a number, is the number of sixtieths of a second before tcp.httpClient will time out
flMessages, a boolean, if true, tcp.httpClient will display progress messages in the About window
ctFollowRedirects, a number defaulting to 0, is the number of HTTP redirects that the script will follow
|
| Notes |
All of its parameters are optional, the usual usage is to only specify some of the parameters and label all parameters with their names.
If the server string contains a colon, for example, www.scripting.com:80, we use that port for the HTTP request. If no port is specified by the caller, or is encoded in the server string, we talk to port 80 on the server.
When following redirects, it is recommended that flFollowRedirects is not set to a value higher than 5, since receiving this many redirects usually indicates that the script is stuck in an infinite redirection loop.
This verb is implemented as a script.
|