Version: v0.8.1 - Beta.  We welcome contributors & feedback.

Net.httpGet

Net.httpGet($url, $headers={}) -> string|map

Description

Send an HTTP GET request and get the response.

$url must be a URL TypeString.

$headers is an optional map of HTTP request headers.

If the response body is JSON, it will be returned as a Map. Otherwise, it will be returned as a string.

// Basic call
$content = Net.httpGet(url'https://example.com')

// With headers
$headers = {
    'Cookie': 'sessionId=1234'
}
$content = Net.httpGet(url'https://example.com', $headers)