ApplesauceOS
Read Markdown ↗Download .md

httpRequest

Make a synchronous text HTTP request.

js
httpRequest(url, method = "GET", headers?, body?)

Arguments

ArgumentTypeMeaning
urlstringHTTP(S) URL.
methodstringDefault GET.
headersobjectOptional string header values.
bodystringOptional body; serialize JSON yourself.

Returns

Response text, or null on failure; cancellation may throw.

Example

js
const text = httpRequest("https://example.com", "GET");
if (text === null) throw new Error("Request failed");
console.log(text);

Notes

Wait deadline 30 seconds. Does not expose status or response headers; prefer fetch when you need them.

All JavaScript APIs · Automation playbook