TsgcHTTP3Client › Methods › OptionsAsync

OptionsAsync Method

Sends a non-blocking HTTP/3 OPTIONS request; the reply arrives on OnResponse.

Syntax

procedure OptionsAsync(const aURL: string);

Parameters

NameTypeDescription
aURLconst stringAbsolute URL of the target resource.

Return Value

None. The response is delivered on OnResponse.

Remarks

The request runs on a background thread and the method returns immediately. The reply is delivered on OnResponse, and a failure is reported on OnError.

OPTIONS asks the server which methods and capabilities the target resource supports. Note the synchronous counterpart is named RequestOptions, because Options collides with an existing identifier in Delphi and C++Builder.

The synchronous counterpart is RequestOptions, which blocks and returns the body directly.

The events fire on the background worker thread that carried out the request, not on the main thread. Synchronise before touching VCL or FMX controls from the handler.

Example



oClient.OnResponse := OnResponseEvent;

oClient.OptionsAsync('https://api.example.com/v1/items');

Back to Methods