HTTP.PUT
Send an HTTP PUT request. Used to replace an existing resource on the server. Please refer to https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods for more information about the different HTTP methods
Syntax
=HTTP.PUT(URL, [Body], [HeadersJSON], [ConfigJSON], [Target])
Arguments
Name | Type | Description |
---|---|---|
URL | String | The URL to request. |
Body (optional) | String | The body of the request. |
HeadersJSON (optional) | JSON | Headers of the HTTP request. |
ConfigJSON (optional) | JSON | A JSON with one or more of the following properties:
|
Target (optional) | Target | INBOX(), OUTBOX("MsgID") or a cell range where the result will be placed. Make sure the cell range is big enough or not everything is displayed. |
Return
Type | Description |
---|---|
HTTP Response or Error | The function HTTP.PUT() returns a HTTP response JSON. Otherwise an error is displayed. |
Examples
A | B | |
---|---|---|
1 | Headers | |
2 | Accept | application/json |
3 | Config | |
4 | timeout | 3000 |
5 | ||
6 | id | 5 |
7 | data | exampleData |
Examples for using the config and header parameter. Use a JSON() function around the cell ranges.
Formula | Result | Comment |
---|---|---|
| Sends a PUT Request to the API | |
| Sends a PUT Request to the API | Use the "Accept: application/json" header and a timeout of 3 seconds for the request. |
| Sends a PUT Request to the API | The HTTP response is placed into the inbox of "Sheet1" |