Version: v0.6.1 - Beta.  We welcome contributors & feedback.  THanks!


Net.httpRequest($method, $url, $data = '', $headers = {})


Send an HTTP request and get the body of the response as a string.

$method is the HTTP method. (e.g. 'GET', 'POST')

$url must be a URL TypeString.

$data can be a string containing the raw request body, or a Map, which will be converted to a URL-encoded string.

$headers is an optional map of HTTP request headers.

// Basic call
$content = Net.httpRequest('GET', url'');

// With headers
$headers = {
    'Cookie': 'sessionId=1234; otherCookie=1;'
$data = { myVar:};
$content2 = Net.httpRequest(
    { myVar: 1 },