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.

Http3Client

HTTP/3 client over QUIC. Maintains a persistent QUIC connection via a native Http3Session.

client := Http3Client->New("cloudflare-quic.com");
resp := client->Get("/");
if(resp <> Nil) {
   resp->GetCode()->PrintLine();
};
client->Close();

Operations

AddHeader #

Adds a custom request header sent with every subsequent request.

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

Parameters

NameTypeDescription
keyStringheader name (lower-case recommended)
valueStringheader value

Example

client := Web.HTTP.Http3Client->New("api.example.com");
client->AddHeader("authorization", "Bearer mytoken");
client->AddHeader("accept", "application/json");
resp := client->Get("/v1/items");
resp->GetCode()->PrintLine();
client->Close();

Close #

Closes the QUIC connection and releases resources.

method : public : Close() ~ Nil

Example

client := Web.HTTP.Http3Client->New("api.example.com");
resp := client->Get("/data");
resp->GetCode()->PrintLine();
client->Close();  # release QUIC/ngtcp2 session

Delete #

Performs an HTTP/3 DELETE request.

method : public : Delete(path:String) ~ Response

Parameters

NameTypeDescription
pathStringrequest path

Return

TypeDescription
ResponseResponse or Nil on failure

Example

client := Web.HTTP.Http3Client->New("api.example.com");
resp := client->Delete("/records/5");
resp->GetCode()->PrintLine();  # 204
client->Close();

Get #

Performs an HTTP/3 GET request.

method : public : Get(path:String) ~ Response

Parameters

NameTypeDescription
pathStringrequest path

Return

TypeDescription
ResponseResponse or Nil on failure

Example

client := Web.HTTP.Http3Client->New("cloudflare-quic.com");
resp := client->Get("/cdn-cgi/trace");
if(resp <> Nil) {
  resp->GetCode()->PrintLine();              # 200
  String->New(resp->GetContent())->PrintLine();
};
client->Close();

IsConnected #

Returns true if the QUIC connection is established

method : public : IsConnected() ~ Bool

Example

client := Web.HTTP.Http3Client->New("cloudflare-quic.com");
if(client->IsConnected()) {
  resp := client->Get("/");
  resp->GetCode()->PrintLine();  # 200
};
client->Close();

New # constructor

Creates an HTTP/3 client connected to the given host.

New(host:String, port:Int)

Parameters

NameTypeDescription
hostStringhostname (e.g. "api.example.com")
portIntport number (default 443)

Patch #

Performs an HTTP/3 PATCH request.

method : public : Patch(path:String, body:Byte[], content_type:String) ~ Response

Parameters

NameTypeDescription
pathStringrequest path
bodyByterequest body bytes
content_typeStringMIME type of the body

Return

TypeDescription
ResponseResponse or Nil on failure

Example

client := Web.HTTP.Http3Client->New("api.example.com");
payload := "{\"active\":false}"->ToByteArray();
resp := client->Patch("/users/3", payload, "application/json");
resp->GetCode()->PrintLine();  # 200
client->Close();

Post #

Performs an HTTP/3 POST request.

method : public : Post(path:String, body:Byte[], content_type:String) ~ Response

Parameters

NameTypeDescription
pathStringrequest path
bodyByterequest body bytes
content_typeStringMIME type of the body

Return

TypeDescription
ResponseResponse or Nil on failure

Example

client := Web.HTTP.Http3Client->New("api.example.com");
payload := "{\"name\":\"test\"}"->ToByteArray();
resp := client->Post("/items", payload, "application/json");
resp->GetCode()->PrintLine();  # 201
client->Close();

Put #

Performs an HTTP/3 PUT request.

method : public : Put(path:String, body:Byte[], content_type:String) ~ Response

Parameters

NameTypeDescription
pathStringrequest path
bodyByterequest body bytes
content_typeStringMIME type of the body

Return

TypeDescription
ResponseResponse or Nil on failure

Example

client := Web.HTTP.Http3Client->New("api.example.com");
payload := "{\"value\":99}"->ToByteArray();
resp := client->Put("/settings/theme", payload, "application/json");
resp->GetCode()->PrintLine();  # 200
client->Close();

QuickDelete # function

Performs an HTTP/3 DELETE from a URL in one call.

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

Parameters

NameTypeDescription
urlUrlURL to delete

Return

TypeDescription
ResponseResponse or Nil on failure

Example

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

QuickDelete # function

Performs an HTTP/3 DELETE from a URL with custom headers.

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

Parameters

NameTypeDescription
urlUrlURL to delete
headersMap<String,String>optional key/value headers

Return

TypeDescription
ResponseResponse or Nil on failure

QuickGet # function

Performs an HTTP/3 GET from a URL in one call.

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

Parameters

NameTypeDescription
urlUrlURL to fetch

Return

TypeDescription
ResponseResponse or Nil on failure

Example

url := Web.HTTP.Url->New("https://cloudflare-quic.com/cdn-cgi/trace");
resp := Web.HTTP.Http3Client->QuickGet(url);
if(resp <> Nil) {
  resp->GetCode()->PrintLine();              # 200
  String->New(resp->GetContent())->PrintLine();
};

QuickGet # function

Performs an HTTP/3 GET from a URL with custom headers.

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

Parameters

NameTypeDescription
urlUrlURL to fetch
headersMap<String,String>optional key/value headers

Return

TypeDescription
ResponseResponse or Nil on failure

QuickPatch # function

Performs an HTTP/3 PATCH from a URL in one call.

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

Parameters

NameTypeDescription
urlUrlURL to patch
dataByterequest body

Return

TypeDescription
ResponseResponse or Nil on failure

QuickPatch # function

Performs an HTTP/3 PATCH from a URL with a content type.

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

Parameters

NameTypeDescription
urlUrlURL to patch
dataByterequest body
content_typeStringMIME type

Return

TypeDescription
ResponseResponse or Nil on failure

QuickPatch # function

Performs an HTTP/3 PATCH from a URL with content type and headers.

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

Parameters

NameTypeDescription
urlUrlURL to patch
dataByterequest body
content_typeStringMIME type
headersMap<String,String>optional key/value headers

Return

TypeDescription
ResponseResponse or Nil on failure

QuickPost # function

Performs an HTTP/3 POST from a URL in one call.

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

Parameters

NameTypeDescription
urlUrlURL to post to
dataByterequest body

Return

TypeDescription
ResponseResponse or Nil on failure

Example

url := Web.HTTP.Url->New("https://api.example.com/submit");
body := "{\"msg\":\"hello\"}"->ToByteArray();
resp := Web.HTTP.Http3Client->QuickPost(url, body, "application/json");
resp->GetCode()->PrintLine();  # 200

QuickPost # function

Performs an HTTP/3 POST from a URL with a content type.

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

Parameters

NameTypeDescription
urlUrlURL to post to
dataByterequest body
content_typeStringMIME type

Return

TypeDescription
ResponseResponse or Nil on failure

QuickPost # function

Performs an HTTP/3 POST from a URL with content type and headers.

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

Parameters

NameTypeDescription
urlUrlURL to post to
dataByterequest body
content_typeStringMIME type
headersMap<String,String>optional key/value headers

Return

TypeDescription
ResponseResponse or Nil on failure

QuickPut # function

Performs an HTTP/3 PUT from a URL in one call.

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

Parameters

NameTypeDescription
urlUrlURL to put to
dataByterequest body

Return

TypeDescription
ResponseResponse or Nil on failure

QuickPut # function

Performs an HTTP/3 PUT from a URL with a content type.

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

Parameters

NameTypeDescription
urlUrlURL to put to
dataByterequest body
content_typeStringMIME type

Return

TypeDescription
ResponseResponse or Nil on failure

QuickPut # function

Performs an HTTP/3 PUT from a URL with content type and headers.

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

Parameters

NameTypeDescription
urlUrlURL to put to
dataByterequest body
content_typeStringMIME type
headersMap<String,String>optional key/value headers

Return

TypeDescription
ResponseResponse or Nil on failure

RemoveHeader #

Removes a previously added request header.

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

Parameters

NameTypeDescription
keyStringheader name

Example

client := Web.HTTP.Http3Client->New("api.example.com");
client->AddHeader("x-debug", "1");
client->RemoveHeader("x-debug");
resp := client->Get("/ping");
client->Close();