http.put

Prev Next

Description

Performs an HTTP PUT to a specified network resource URI and returns the response.


Input Parameters

Name Type Required Description
uri Text Yes Network resource URI
[headers] Text No Request headers
[body] Text No Request body
[contentType] Text No Request body content type

Returns

An array response from the network resource, including both the response code and message.

Common Response Codes:

Code Description
200 Success / OK
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
500 Internal Server Error
501 Not Implemented

Examples

// send http PUT
var response = network.http.put("https://mydomain.com/test");

// get response code and message
var code = response[0];
var message = response[1];
// prepare headers
var headers = {
    "X-User-Name": "John Doe",
    "Age": 30
};

// prepare body
var body = {
    Name: "Doe, John",
    Age: 30
};

// send http PUT, passing URL arguments, headers, and body
var response = network.http.put("https://mydomain.com/test?User=Bob", headers, body, "application/json");

// get response code and message
var code = response[0];
var message = response[1];

Remarks

Inputs can be passed both on the resource URI and via any passed header name-value pairs.