The Skinny On...
HTTP
The system.http object provides access to requesting data
from remote HTTP servers.
-
Object request( String method, String uri [, Array headers[, String content ]] )The
requestfunction makes an HTTP request to a remote http server. The HTTP method (GET, POST, etc) used is specified with the first argument. The second argument is the URI to request.Optionally you can specify the headers that will form the request as an Array in the third argument. The array should take the form:
[ 'X-Header-Name', 'a value' ]The optional fourth argument is a string containing the body of the request, for example in an HTTP POST.
The object that gets returned from the
request()function has the following properties:-
Object headersThese are the headers of the response. They are all lowercased, so
Content-Typebecomescontent-type, etc. -
String contentThis is the body of the response. It contains whatever payload the server provides in response to the requst.
-
