Skip to main content
Version: Streamsheets 3.0

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

NameTypeDescription
URLStringThe URL to request.
Body (optional)StringThe body of the request.
HeadersJSON (optional)JSONHeaders of the HTTP request.
ConfigJSON (optional)JSONA JSON with one or more of the following properties:
  • baseURL: string
  • timeout: positive number, timout in milliseconds
  • auth: object with the following properties
    • username: string
    • password: string
  • proxy: object one or more of the following properties
    • protocol: string, "http" or "https"
    • host: string, hostname or IP of the proxy server
    • port: number
    • auth: object with the following properties
      • username: string
      • password: string
Target (optional)TargetINBOX(), 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

TypeDescription
HTTP Response or ErrorThe function HTTP.PUT() returns a HTTP response JSON. Otherwise an error is displayed.

Examples

AB
1Headers
2Acceptapplication/json
3Config
4timeout3000
5
6id5
7dataexampleData

Examples for using the config and header parameter. Use a JSON() function around the cell ranges.

FormulaResultComment
=HTTP.PUT("https://www.example.org/user/0, JSON(A6:B7))
Sends a PUT Request to the API
=HTTP.PUT("https://www.example.org/user/0, JSON(A6:B7), JSON(A2:B2), JSON(A4:B4))
Sends a PUT Request to the APIUse the "Accept: application/json" header and a timeout of 3 seconds for the request.
=HTTP.PUT("https://www.example.org/user/0, JSON(A6:B7), , , INBOX("Sheet1"))
Sends a PUT Request to the APIThe HTTP response is placed into the inbox of "Sheet1"