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
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 |