Skip to main content

http.get(url, headers)

Returns a new HTTP GET request object

Availability

Agent

Parameters

Name Type Description
url String The URL to which the HTTP request will be made
headers Table Optional table of additional HTTP headers

Returns

An httprequest object

Description

This method returns an httprequest object primed to make an HTTP/1.1 GET request to the specified URL. The request isn’t issued until either sendsync() or sendasync() is called on the returned httprequest object.

The URL must start with "http://" or "https://" — ie. it must include the colon and the double-slash.

The headers can be any supported by HTTP, for instance:

{ "Content-Type" : "text/xml" }

Note Headers are specified without the colon.