v2026.5.3
All Bundles
Bundle Shared networking types used across all HTTP libraries: Url (parsing and construction), Response (status code, headers, body), Cookie, and WebDownloader for streaming downloads. Compile with -lib net.

HttpsClient

HTTPS client

html := HttpsClient->QuickGet(Web.HTTP.Url->New("https://www.nasa.gov")->ToString();
if(html <> Nil) {
   html->PrintLine();
};

Operations

AddHeader #

Adds a HTTPS request header

method : public : AddHeader(name:String, value:String) ~ Nil

Parameters

NameTypeDescription
nameStringheader name
valueStringheader value

Example

client := Web.HTTP.HttpsClient->New();
client->AddHeader("Authorization", "Bearer token123");
client->AddHeader("Accept", "application/json");
response := client->Get(Web.HTTP.Url->New("https://api.example.com/users"));
response->GetCode()->PrintLine();

Delete #

Performs a HTTPS DELETE

method : public : Delete(url:Web.HTTP.Url, content_type:String) ~ Web.HTTP.Response

Parameters

NameTypeDescription
urlUrlURL
content_typeStringcontent type

Return

TypeDescription
Responsestring read

EnableCookies #

Sets cookie support

method : public : EnableCookies(cookies_enabled:Bool) ~ Nil

Parameters

NameTypeDescription
cookies_enabledBooltrue if cookies are enabled, false otherwise

Example

client := Web.HTTP.HttpsClient->New();
client->EnableCookies(true);
client->Get(Web.HTTP.Url->New("https://example.com/login"));  # server sets cookie
client->Get(Web.HTTP.Url->New("https://example.com/profile")); # cookie sent automatically

Get #

Performs a HTTPS GET

method : public : Get(url:Web.HTTP.Url) ~ Web.HTTP.Response

Parameters

NameTypeDescription
urlUrlURL

Return

TypeDescription
Responsestring read

Get #

Performs a HTTPS GET

method : public : Get(url:Web.HTTP.Url, content_type:String) ~ Web.HTTP.Response

Parameters

NameTypeDescription
urlUrlURL
content_typeStringcontent type

Return

TypeDescription
Responsestring read

Get #

Performs a HTTPS GET

method : public : Get(url:Web.HTTP.Url, content_type:String, ) ~ Web.HTTP.Response

Parameters

NameTypeDescription
urlUrlURL
content_typeStringcontent type

Return

TypeDescription
Responsestring read

GetCookie #

Get a cookie

method : public : GetCookie(name:String) ~ Cookie

Parameters

NameTypeDescription
nameStringcookie name

Return

TypeDescription
Cookiefound cookie, Nil otherwise

GetCookies #

Gets the cookies

method : public : GetCookies() ~ Vector<Cookie>

Return

TypeDescription
Vector<Cookie>vector of cookies

GetIssuer #

Gets the socket's X.509 certificate issuer name

method : public : GetIssuer() ~ String

Return

TypeDescription
Stringcertificate issuer name

Example

client := Web.HTTP.HttpsClient->New();
client->Get(Web.HTTP.Url->New("https://example.com/"));
client->GetIssuer()->PrintLine();   # e.g. "Let's Encrypt Authority X3"

GetRequestHeaders #

Gets the HTTPS request headers

method : public : GetRequestHeaders() ~ Hash<String,String>

Return

TypeDescription
Hash<String,String>HTTPS request headers

GetResponseHeaders #

Gets the HTTPS response headers

method : public : GetResponseHeaders() ~ Hash<String,String>

Return

TypeDescription
Hash<String,String>HTTPS response headers

GetSubject #

Gets the socket's X.509 certificate subject name

method : public : GetSubject() ~ String

Return

TypeDescription
Stringcertificate subject name

Example

client := Web.HTTP.HttpsClient->New();
client->Get(Web.HTTP.Url->New("https://example.com/"));
client->GetSubject()->PrintLine();  # e.g. "CN=example.com"

HasCookie #

Checks for a cookie

method : public : HasCookie(name:String) ~ Bool

Parameters

NameTypeDescription
nameStringcookie name

Return

TypeDescription
Booltrue if found cookie, false otherwise

New # constructor

Default constructor

New(cookies_enabled:Bool)

Parameters

NameTypeDescription
cookies_enabledBooltrue if cookies are enabled, false otherwise

Example

client := Web.HTTP.HttpsClient->New();
client->AddHeader("Authorization", "Bearer mytoken");
response := client->Get(Web.HTTP.Url->New("https://api.example.com/data"));
if(response <> Nil) {
  response->GetCode()->PrintLine();  # 200
};

Patch #

Performs a HTTPS PATCH

method : public : Patch(url:Web.HTTP.Url, data:Byte[], content_type:String) ~ Web.HTTP.Response

Parameters

NameTypeDescription
urlUrlURL
dataBytedata to patch
content_typeStringcontent type

Return

TypeDescription
Responsestring read

Patch #

Performs a HTTPS PATCH

method : public : Patch(url:Web.HTTP.Url, data:Byte[], content_type:String, pem:String) ~ Web.HTTP.Response

Parameters

NameTypeDescription
urlUrlURL
dataBytedata to patch
content_typeStringcontent type
pemStringthe Privacy Enhanced Mail file

Return

TypeDescription
Responsestring read

Patch #

Performs a HTTPS PATCH

method : public : Patch(url:Web.HTTP.Url, data:Byte[]) ~ Web.HTTP.Response

Parameters

NameTypeDescription
urlUrlURL
dataBytedata to patch

Return

TypeDescription
Responsestring read

Post #

Performs a HTTPS POST

method : public : Post(url:Web.HTTP.Url, data:Byte[], content_type:String) ~ Web.HTTP.Response

Parameters

NameTypeDescription
urlUrlURL
dataBytedata to oper
content_typeStringcontent type

Return

TypeDescription
Responsestring read

Post #

Performs a HTTPS POST

method : public : Post(url:Web.HTTP.Url, data:Byte[], content_type:String, pem:String) ~ Web.HTTP.Response

Parameters

NameTypeDescription
urlUrlURL
dataBytedata to oper
content_typeStringcontent type
pemStringthe Privacy Enhanced Mail file

Return

TypeDescription
Responsestring read

Post #

Performs a HTTPS POST

method : public : Post(url:Web.HTTP.Url, data:Byte[]) ~ Web.HTTP.Response

Parameters

NameTypeDescription
urlUrlURL
dataBytedata to oper

Return

TypeDescription
Responsestring read

Put #

Performs a HTTPS PUT

method : public : Put(url:Web.HTTP.Url, data:Byte[], content_type:String) ~ Web.HTTP.Response

Parameters

NameTypeDescription
urlUrlURL
dataBytedata to oper
content_typeStringcontent type

Return

TypeDescription
Responsestring read

Put #

Performs a HTTPS PUT

method : public : Put(url:Web.HTTP.Url, data:Byte[], content_type:String, pem:String) ~ Web.HTTP.Response

Parameters

NameTypeDescription
urlUrlURL
dataBytedata to oper
content_typeStringcontent type
pemStringthe Privacy Enhanced Mail file

Return

TypeDescription
Responsestring read

Put #

Performs a HTTPS PUT

method : public : Put(url:Web.HTTP.Url, data:Byte[]) ~ Web.HTTP.Response

Parameters

NameTypeDescription
urlUrlURL
dataBytedata to oper

Return

TypeDescription
Responsestring read

QuickDelete # function

Performs a HTTPS DELETE and returns results as a String

function : QuickDelete(url:Web.HTTP.Url) ~ Web.HTTP.Response

Parameters

NameTypeDescription
urlUrlURL

Return

TypeDescription
Responseoutput buffer

Example

url := Web.HTTP.Url->New("https://api.example.com/items/42");
response := Web.HTTP.HttpsClient->QuickDelete(url);
response->GetCode()->PrintLine();  # 204

QuickDelete # function

Performs a HTTPS DELETE and returns results as a String

function : QuickDelete(url:Web.HTTP.Url, headers:Map<String,String>) ~ Web.HTTP.Response

Parameters

NameTypeDescription
urlUrlURL
headersMap<String,String>key/value headers

Return

TypeDescription
Responseoutput buffer

QuickDelete # function

Performs a HTTPS DELETE and returns results as a String

function : QuickDelete(url:Web.HTTP.Url, content_type:String) ~ Web.HTTP.Response

Parameters

NameTypeDescription
urlUrlURL
content_typeStringcontent type

Return

TypeDescription
Responseoutput buffer

QuickDelete # function

Performs a HTTPS DELETE and returns results as a String

function : QuickDelete(url:Web.HTTP.Url, content_type:String, headers:Map<String,String>) ~ Web.HTTP.Response

Parameters

NameTypeDescription
urlUrlURL
content_typeStringcontent type
headersMap<String,String>key/value headers

Return

TypeDescription
Responseoutput buffer

QuickDelete # function

Performs a HTTPS DELETE and returns results as a String

function : QuickDelete(url:Web.HTTP.Url, content_type:String, headers:Map<String,String>, pem:String) ~ Web.HTTP.Response

Parameters

NameTypeDescription
urlUrlURL
content_typeStringcontent type
headersMap<String,String>key/value headers
pemStringthe Privacy Enhanced Mail file

Return

TypeDescription
Responseoutput buffer

QuickGet # function

Performs a HTTPS GET and returns results as a String

function : QuickGet(url:Web.HTTP.Url) ~ Web.HTTP.Response

Parameters

NameTypeDescription
urlUrlURL

Return

TypeDescription
Responseoutput buffer

Example

url := Web.HTTP.Url->New("https://httpbin.org/get");
response := Web.HTTP.HttpsClient->QuickGet(url);
if(response <> Nil) {
  response->GetCode()->PrintLine();            # 200
  String->New(response->GetContent())->PrintLine();  # JSON body
};

QuickGet # function

Performs a HTTPS GET and returns results as a String

function : QuickGet(url:Web.HTTP.Url, headers:Map<String,String>) ~ Web.HTTP.Response

Parameters

NameTypeDescription
urlUrlURL
headersMap<String,String>key/value headers

Return

TypeDescription
Responseoutput buffer

QuickGet # function

Performs a HTTPS GET and returns results as a String

function : QuickGet(url:Web.HTTP.Url, content_type:String) ~ Web.HTTP.Response

Parameters

NameTypeDescription
urlUrlURL
content_typeStringcontent type

Return

TypeDescription
Responseoutput buffer

QuickGet # function

Performs a HTTPS GET and returns results as a String

function : QuickGet(url:Web.HTTP.Url, content_type:String, headers:Map<String,String>) ~ Web.HTTP.Response

Parameters

NameTypeDescription
urlUrlURL
content_typeStringcontent type
headersMap<String,String>key/value headers

Return

TypeDescription
Responseoutput buffer

QuickGet # function

Performs a HTTPS GET and returns results as a String

function : QuickGet(url:Web.HTTP.Url, content_type:String, headers:Map<String,String>, pem:String) ~ Web.HTTP.Response

Parameters

NameTypeDescription
urlUrlURL
content_typeStringcontent type
headersMap<String,String>key/value headers
pemStringthe Privacy Enhanced Mail file

Return

TypeDescription
Responseoutput buffer

QuickPatch # function

Performs a HTTPS PATCH

function : QuickPatch(url:Web.HTTP.Url, data:Byte[]) ~ Web.HTTP.Response

Parameters

NameTypeDescription
urlUrlURL
dataBytedata to patch

Return

TypeDescription
Responseread strings

Example

url := Web.HTTP.Url->New("https://api.example.com/items/1");
body := "{\"status\":\"active\"}"->ToByteArray();
response := Web.HTTP.HttpsClient->QuickPatch(url, body, "application/json");
response->GetCode()->PrintLine();  # 200

QuickPatch # function

Performs a HTTPS PATCH

function : QuickPatch(url:Web.HTTP.Url, data:Byte[], content_type:String) ~ Web.HTTP.Response

Parameters

NameTypeDescription
urlUrlURL
dataBytedata to patch
content_typeStringcontent type

Return

TypeDescription
Responseread strings

QuickPatch # function

Performs a HTTPS PATCH

function : QuickPatch(url:Web.HTTP.Url, data:Byte[], content_type:String, headers:Map<String,String>) ~ Web.HTTP.Response

Parameters

NameTypeDescription
urlUrlURL
dataBytedata to patch
content_typeStringcontent type
headersMap<String,String>key/value headers

Return

TypeDescription
Responseread strings

QuickPost # function

Performs a HTTPS POST

function : QuickPost(url:Web.HTTP.Url, data:Byte[]) ~ Web.HTTP.Response

Parameters

NameTypeDescription
urlUrlURL
dataBytedata to oper

Return

TypeDescription
Responseread strings

Example

url := Web.HTTP.Url->New("https://httpbin.org/post");
body := "field=value"->ToByteArray();
response := Web.HTTP.HttpsClient->QuickPost(url, body);
response->GetCode()->PrintLine();  # 200

QuickPost # function

Performs a HTTPS POST

function : QuickPost(url:Web.HTTP.Url, data:Byte[], content_type:String) ~ Web.HTTP.Response

Parameters

NameTypeDescription
urlUrlURL
dataBytedata to oper
content_typeStringcontent type

Return

TypeDescription
Responseread strings

QuickPost # function

Performs a HTTPS POST

function : QuickPost(url:Web.HTTP.Url, data:Byte[], content_type:String, headers:Map<String,String>) ~ Web.HTTP.Response

Parameters

NameTypeDescription
urlUrlURL
dataBytedata to oper
content_typeStringcontent type
headersMap<String,String>key/value headers

Return

TypeDescription
Responseread strings

QuickPut # function

Performs a HTTP POST

function : QuickPut(url:Web.HTTP.Url, data:Byte[]) ~ Web.HTTP.Response

Parameters

NameTypeDescription
urlUrlURL
dataBytedata to oper

Return

TypeDescription
Responseread strings

QuickPut # function

Performs a HTTPS POST

function : QuickPut(url:Web.HTTP.Url, data:Byte[], content_type:String) ~ Web.HTTP.Response

Parameters

NameTypeDescription
urlUrlURL
dataBytedata to oper
content_typeStringcontent type

Return

TypeDescription
Responseread strings

QuickPut # function

Performs a HTTP POST

function : QuickPut(url:Web.HTTP.Url, data:Byte[], content_type:String, headers:Map<String,String>) ~ Web.HTTP.Response

Parameters

NameTypeDescription
urlUrlURL
dataBytedata to oper
content_typeStringcontent type
headersMap<String,String>key/value headers

Return

TypeDescription
Responseread strings

RemoveHeader #

Removes a HTTPS request header

method : public : RemoveHeader(name:String) ~ Nil

Parameters

NameTypeDescription
nameStringheader name

Example

client := Web.HTTP.HttpsClient->New();
client->RemoveHeader("Cache-Control");  # strip default cache header
response := client->Get(Web.HTTP.Url->New("https://api.example.com/data"));
response->GetCode()->PrintLine();

SetCookie #

Sets a cookie

method : public : SetCookie(cookie:Cookie) ~ Nil

Parameters

NameTypeDescription
cookieCookiecookie

SetMaxRedirects #

Sets the maximum number of redirects to follow (default 10)

method : public : SetMaxRedirects(max:Int) ~ Nil

Parameters

NameTypeDescription
maxIntmaximum redirects

Example

client := Web.HTTP.HttpsClient->New();
client->SetMaxRedirects(5);
response := client->Get(Web.HTTP.Url->New("https://httpbin.org/redirect/3"));
response->GetCode()->PrintLine();  # 200

SetRetry #

Sets retry behavior for transient errors (429, 503)

method : public : SetRetry(max_retries:Int, delay_ms:Int) ~ Nil

Parameters

NameTypeDescription
max_retriesIntmaximum retry attempts (default 3, 0 to disable)
delay_msIntinitial delay between retries in milliseconds (default 1000, doubles each retry)

Example

client := Web.HTTP.HttpsClient->New();
client->SetRetry(5, 500);  # retry up to 5 times, starting at 500ms
response := client->Get(Web.HTTP.Url->New("https://api.example.com/data"));
response->GetCode()->PrintLine();

StreamPost #

Performs an HTTPS POST and returns an SSE stream for reading events. Used for streaming responses from LLM APIs.

method : public : StreamPost(url:Web.HTTP.Url, data:Byte[], content_type:String) ~ SSEStream

Parameters

NameTypeDescription
urlUrlURL
dataByterequest body
content_typeStringcontent type

Return

TypeDescription
SSEStreamSSE stream, or Nil on error

Example

client := Web.HTTP.HttpsClient->New();
client->AddHeader("Authorization", "Bearer mykey");
url := Web.HTTP.Url->New("https://api.openai.com/v1/chat/completions");
body := "{\"model\":\"gpt-4o\",\"stream\":true,\"messages\":[]}"->ToByteArray();
stream := client->StreamPost(url, body, "application/json");
if(stream <> Nil) {
  while(stream->HasNext()) {
    stream->Next()->GetData()->PrintLine();
  };
  stream->Close();
};

StreamPost #

Performs an HTTPS POST and returns an SSE stream for reading events.

method : public : StreamPost(url:Web.HTTP.Url, data:Byte[], content_type:String, pem:String) ~ SSEStream

Parameters

NameTypeDescription
urlUrlURL
dataByterequest body
content_typeStringcontent type
pemStringPEM certificate

Return

TypeDescription
SSEStreamSSE stream, or Nil on error