Send an HTTP request
http_requestSend HTTP requests with configurable method, headers, body, and timeout. Returns status, headers, timing, and parsed JSON response. Redirects are followed and private addresses blocked.
Instructions
Sends an HTTP request and returns the status, headers, timing, and body, parsing the body as JSON when the content type says so. Redirects are followed manually so each hop can be re-checked. Responses are capped at 256 KB. Requests to private and loopback addresses are refused unless DEVKIT_ALLOW_PRIVATE_HOSTS=1 is set.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The absolute http or https URL to request. | |
| body | No | Request body. Ignored for GET and HEAD. | |
| method | No | HTTP method. | GET |
| headers | No | Request headers as a name-to-value object. | |
| timeoutMs | No | Abort the request after this many milliseconds. | |
| followRedirects | No | Follow 3xx responses. Every hop is re-checked against the host policy. |