518 B
518 B
HTTP APIs.
http.request(url, options?)
Performs a HTTP call, proxied via the server (to avoid CORS issues).
Options:
method
: GET, POST, PUT, DELETE (GET is default)headers
: table with header -> value mappingsbody
: either a string or table (which will be JSON stringified)
Returns:
ok
: boolean if the request went okstatus
: HTTP status codeheaders
: HTTP headersbody
: for content types:text/*
: stringapplication/json
: parsed JSON object- anything else: UInt8Array