$httpGet[]
Performs an HTTP GET request to the specified URL and returns the response body as a string
$httpGet[url]
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| url | string | check_circle Required | — | The full URL to fetch (including https://). Query parameters should be included directly in the URL. |
Return Value
The response body as a plain text string. The response can be parsed as JSON using $httpResult for structured access.
$httpGet sends a synchronous HTTP GET request to the provided URL. The function blocks the command execution until a response is received or the request times out. Custom headers can be added before the call using $httpAddHeader. After the request completes, the raw response body is stored internally and can be accessed via $httpResult. Use $httpStatus to check the HTTP status code of the response.
The URL must be a fully qualified URL including the scheme (https:// or http://). For best results with JSON APIs, use $httpResult with dot or bracket notation to extract specific fields from the parsed JSON response.
Examples
Fetch a public API
$httpGet[https://api.github.com/users/octocat]
$description[GitHub user: $httpResult[name] has $httpResult[followers] followers]
Fetch with query parameters
$httpGet[https://jsonplaceholder.typicode.com/posts?userId=1]
$description[First post title: $httpResult[0;title]]
Fetch and inspect status
$httpGet[https://httpbin.org/get]
Status: $httpStatus
Origin IP: $httpResult[origin]