ns_http - Simple HTTP client functionality
This command provides a simple HTTP client mechanism.
Cancel queued http request by id (ns_set id of request).
Cancel all pending http requests
Return the list of currently running or pending requests in format: id url done|running ....
-method use the specified HTTP method such as GET or POST or HEAD
-headers headers is the ns_set ID containing the additional headers to include in the HTTP request. -body body is the value which will be sent as the HTTP request body. -timeout Timeout for how long to wait reply back from the web server
The command ns_http queue returns the ns_set ID of the HTTP request, which might be used later for waiting for this request or canceling this request.
Send a HTTP reuqest and wait for the result. The command ns_http run is similar to ns_http queue followed by ns_http wait.
-elapsed var is the name of a variable that should be used to store the elapsed time for the request from beginning to finish
-result var is the name of a variable that should be used to store the HTTP response body.
-status var is the name of a variable that should be used to store the HTTP response status
-timeout Default timeout is "2:0" (2s, 0usec).
-headers headers is the ns_set ID which will receive the headers from the HTTP response.
id ns_set ID of the HTTP request to wait for.
% ns_http queue http://www.google.com % http0 % ns_http wait -status status -result result http0 % 1
ns_httpget, ns_httppost, ns_httptime, ns_ssl