static/jsvm/functions/_http.send.html
Sends a single HTTP request.
Example:
const res = $http.send({ method: "POST", url: "https://example.com", body: JSON.stringify({"title": "test"}), headers: { 'Content-Type': 'application/json' }})console.log(res.statusCode) // the response HTTP status codeconsole.log(res.headers) // the response headers (eg. res.headers['X-Custom'][0])console.log(res.cookies) // the response cookies (eg. res.cookies.sessionId.value)console.log(res.body) // the response body as raw bytes sliceconsole.log(res.json) // the response body as parsed json array or mapCopy
-
Optional body?: string | FormData-
Optional data?: { [key: string]: any; } -
-
Optional headers?: { [key: string]: string; } -
-
Optional method?: string-
Optional timeout?: number-
-
-
OSLightDark
Generated using TypeDoc