v2026.5.2
All Bundles

Http2Session

HTTP/2 session over TLS. Socket-level primitive for multiplexed HTTP/2 requests via nghttp2. Used by net_h2.obl. Field layout matches Http2Connect/Http2Request expectations: instance[0]=ctx, instance[1]=host, instance[2]=port, instance[3]=pad, instance[4]=resp_status, instance[5]=resp_body, instance[6]=resp_content_type

Operations

Close

Closes the HTTP/2 connection and frees native resources

method : public : Close() ~ Nil

GetResponseBody

Returns the HTTP response body bytes from the last request

method : public : GetResponseBody() ~ Byte[]

GetResponseContentType

Returns the HTTP response Content-Type from the last request

method : public : GetResponseContentType() ~ String

GetResponseStatus

Returns the HTTP response status code from the last request

method : public : GetResponseStatus() ~ Int

IsConnected

Returns true if the connection is established

method : public : IsConnected() ~ Bool

New

Opens an HTTP/2 connection to host:port over TLS.

New(host:String, port:Int)

Parameters

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

Request

Performs a single HTTP/2 request. On success the response fields are populated and the method returns true.

method : public : Request(verb:String, path:String, body:Byte[], content_type:String) ~ Bool

Parameters

NameTypeDescription
verbStringHTTP method string (GET, POST, PUT, DELETE, PATCH)
pathStringrequest path (e.g. "/v1/users")
bodyByterequest body bytes, or Nil for no body
content_typeStringMIME type string, or Nil

Return

TypeDescription
Booltrue on success, false on failure