Skip to main content

http.put(URL, headers, body)

Returns a new HTTP PUT 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
body String The body of the HTTP request

Returns

An httprequest object

Description

This method returns an httprequest object primed to make an HTTP/1.1 PUT 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 that headers are specified without the colon.

The request body can be any string, but most servers will expect its content-type to be as described by the Content-Type header.