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
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() ~ StringGetResponseStatus #
Returns the HTTP response status code from the last request
method : public : GetResponseStatus() ~ IntNew # constructor
Opens an HTTP/2 connection to host:port over TLS.
New(host:String, port:Int)Parameters
| Name | Type | Description |
|---|---|---|
| host | String | hostname (e.g. "api.example.com") |
| port | Int | port 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) ~ BoolParameters
| Name | Type | Description |
|---|---|---|
| verb | String | HTTP method string (GET, POST, PUT, DELETE, PATCH) |
| path | String | request path (e.g. "/v1/users") |
| body | Byte | request body bytes, or Nil for no body |
| content_type | String | MIME type string, or Nil |
Return
| Type | Description |
|---|---|
| Bool | true on success, false on failure |
Request #
As Request, but also sends caller-supplied request headers. A separate overload and a separate trap, rather than an extra parameter on the one above: the trap operand encodes the argument count and only the JIT reads it, so a stale lang.obl paired with a newer VM would desync the operand stack and do so silently, and only once the JIT threshold trips. Keeping the old arity intact means a stale artifact degrades to "headers are not sent" instead.
method : public : Request(headers:String[]) ~ BoolParameters
| Name | Type | Description |
|---|---|---|
| headers | String | alternating key/value, even length, no Nil elements |