HTTP & JSON
httpPut
$httpPut[]
Performs an HTTP PUT request to the specified URL, optionally sending a request body, and returns the response body as a string
Syntax
$httpPut[url;body?]
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| url | string | check_circle Required | — | The full URL to send the PUT request to (including https://) |
| body | string | Optional | — | The request body to send. Typically a JSON string representing the full replacement resource. Omit for an empty PUT. |
Return Value
string
The response body as a plain text string. Use $httpResult to parse JSON responses.
$httpPut sends a synchronous HTTP PUT request, used to replace an entire resource at the given URL. Unlike POST (which creates), PUT is idempotent and should fully replace the target resource. Always set the appropriate Content-Type header via $httpAddHeader before sending. Use $httpResult to access structured JSON responses and $httpStatus to verify the request outcome.
Examples
Update a resource completely
$httpAddHeader[Content-Type;application/json]
$httpPut[https://jsonplaceholder.typicode.com/posts/1;{"id":1,"title":"Updated Title","body":"New content","userId":1}]
$description[Updated: $httpResult[title] (Status: $httpStatus)]
Upload raw content
$httpAddHeader[Content-Type;text/plain]
$httpPut[https://httpbin.org/put;Hello World]
$description[Sent data: $httpResult[data]]