TsgcHTTP3Client › Methods

TsgcHTTP3Client Methods

Public methods grouped by purpose, followed by the full alphabetical list.

HTTP Verbs

The client implements the ten HTTP methods below. The list is exhaustive: it is the Th3Methods enumeration the component encodes into the :method pseudo-header of every request.

VerbSynchronousAsynchronousStream overloadDefault aContentTypeTypical use
GETGetGetAsyncGet(aURL, aResponseContent)—Retrieve a resource. No request body.
POSTPostPostAsyncPost(aURL, aSource, aResponseContent)application/x-www-form-urlencodedSubmit data, typically to create a record or invoke an action.
PUTPutPutAsyncPut(aURL, aSource, aResponseContent)application/jsonReplace the target resource. Idempotent.
DELETEDeleteDeleteAsyncDelete(aURL, aResponseContent)—Remove the target resource. No request body.
HEADHead———Read status and headers only, no body. Returns TsgcHTTP3Response.
PATCHPatchPatchAsyncPatch(aURL, aSource, aResponseContent)application/jsonApply a partial update to the target resource.
OPTIONSRequestOptionsOptionsAsyncRequestOptions(aURL, aResponseContent)—Inspect the methods and capabilities a resource supports.
TRACETraceTraceAsyncTrace(aURL, aResponseContent)—Loop-back diagnostic. Often disabled by servers.
CONNECTConnectConnectAsync——Request a tunnel. See ExtendedConnect for a tunnel that stays open.
QUERYQueryQueryAsyncQuery(aURL, aSource, aResponseContent)application/x-www-form-urlencodedSafe, idempotent request that carries a body. Suits search and filter payloads.

Every verb above is reachable through a synchronous method that blocks and returns the response body as a string, and (except HEAD) an asynchronous method that returns immediately and delivers the reply on OnResponse.

Two naming points are worth knowing. OPTIONS is sent by the method named RequestOptions, because Options collides with an existing identifier in Delphi and C++Builder; its asynchronous counterpart keeps the protocol name and is OptionsAsync. CONNECT is sent by the Connect(aURL) overload, which is a different method from the Connect(aHost, aPort) overload that opens the QUIC connection. Both live on the Connect page.

HEAD is the exception to the pattern: it returns a TsgcHTTP3Response rather than a string, and it has neither an asynchronous variant nor a stream overload.

Every verb except HEAD and CONNECT also has a stream overload, which writes the response body into a TStream instead of building a string, and for body-carrying verbs reads the request body from a source stream. Use it for binary or large payloads. The stream overloads always send content-type: application/octet-stream and do not accept an aContentType parameter, so use the string overload when the media type matters.

The default aContentType column lists the value used by the string overload when the parameter is omitted. Pass it explicitly whenever the server expects something else, for example application/json on a Post.

Connection

NameDescription
ConnectOpens the QUIC connection and performs the TLS 1.3 and HTTP/3 handshake. The URL overload sends the CONNECT verb.
DisconnectCloses the HTTP/3 connection and the underlying QUIC transport.
ConnectedReturns True when the HTTP/3 connection is currently open.

Server Push

NameDescription
SetMaxPushIdSends a MAX_PUSH_ID frame that raises the highest push ID the client accepts. Server push is disabled until this is called.
CancelPushSends a CANCEL_PUSH frame that refuses a promised push by its push ID.

Extended CONNECT and WebTransport

NameDescription
ExtendedConnectPerforms an Extended CONNECT handshake (RFC 9220) and keeps the request stream open as a tunnel.
TunnelSendSends raw bytes as a DATA frame on an open tunnel.
TunnelPumpPumps the QUIC event loop so tunnel data is read and delivered on OnTunnelData.
ServerSupportsWebTransportReturns True when the server SETTINGS advertised WebTransport support.
WebTransportConnectEstablishes a WebTransport session over an Extended CONNECT request.
WebTransportProcessEventsPumps the QUIC connection once so peer-opened WebTransport streams are harvested.

Diagnostics

NameDescription
QPACKDynamicInsertsReturns how many QPACK dynamic-table insertions the request encoder has performed.
BlockedThenResumedCountReturns how many response header sections were blocked on QPACK inserts and later resumed.

All Methods (alphabetical)

NameDescription
BlockedThenResumedCountReturns how many response header sections were blocked on QPACK inserts and later resumed.
CancelPushSends a CANCEL_PUSH frame that refuses a promised push by its push ID.
ConnectOpens the QUIC connection, or sends the HTTP/3 CONNECT verb from the URL overload.
ConnectAsyncSends a non-blocking CONNECT; the reply arrives on OnResponse.
ConnectedReturns True when the HTTP/3 connection is currently open.
DeleteSends a synchronous HTTP/3 DELETE request to remove the target resource.
DeleteAsyncSends a non-blocking DELETE; the reply arrives on OnResponse.
DisconnectCloses the HTTP/3 connection and the underlying QUIC transport.
ExtendedConnectPerforms an Extended CONNECT handshake (RFC 9220) and keeps the request stream open as a tunnel.
GetSends a synchronous HTTP/3 GET request, returning the body as a string or writing it to a stream.
GetAsyncSends a non-blocking GET; the reply arrives on OnResponse.
HeadSends a synchronous HTTP/3 HEAD request and returns the response object with the status and headers.
OptionsAsyncSends a non-blocking OPTIONS; the reply arrives on OnResponse.
PatchSends a synchronous HTTP/3 PATCH request carrying a partial-update payload.
PatchAsyncSends a non-blocking PATCH; the reply arrives on OnResponse.
PostSends a synchronous HTTP/3 POST request with a request body.
PostAsyncSends a non-blocking POST; the reply arrives on OnResponse.
PutSends a synchronous HTTP/3 PUT request with a request body.
PutAsyncSends a non-blocking PUT; the reply arrives on OnResponse.
QPACKDynamicInsertsReturns how many QPACK dynamic-table insertions the request encoder has performed.
QuerySends a synchronous HTTP/3 QUERY request, a safe and idempotent verb that carries a body.
QueryAsyncSends a non-blocking QUERY; the reply arrives on OnResponse.
RequestOptionsSends a synchronous HTTP/3 OPTIONS request to inspect the options of a resource.
ServerSupportsWebTransportReturns True when the server SETTINGS advertised WebTransport support.
SetMaxPushIdSends a MAX_PUSH_ID frame that raises the highest push ID the client accepts.
TraceSends a synchronous HTTP/3 TRACE request used as a loop-back test.
TraceAsyncSends a non-blocking TRACE; the reply arrives on OnResponse.
TunnelPumpPumps the QUIC event loop so tunnel data is read and delivered on OnTunnelData.
TunnelSendSends raw bytes as a DATA frame on an open Extended CONNECT tunnel.
WebTransportConnectEstablishes a WebTransport session over an Extended CONNECT request.
WebTransportProcessEventsPumps the QUIC connection once so peer-opened WebTransport streams are harvested.