greenServeFEgreenServeFE

Documentation home / Native Module API

Native Module API

Outbound HTTP Client

HTTP request, GET and POST operations implemented using libcurl.

Purpose

HTTP request, GET and POST operations implemented using libcurl.

Exports registered by the module initializer

ExportRole
requestrequest exported function or value
getget exported function or value
postpost exported function or value

Usage example

import gs_http;
define response = gs_http.get("https://example.com");
print(response.status);
print(response.ok);
print(response.body);
request(method, url, body?, headers?) returns status, ok, body, headers and error. TLS verification is enabled; redirect count and connection/total timeouts are bounded. Requires libcurl.

Related references

Module catalog · Native ABI · GSVE language