TsgcHTTP3Client › Methods › RequestOptions
Sends a synchronous HTTP/3 OPTIONS request to inspect the communication options of a resource.
function RequestOptions(const aURL: string): string; overload;
| Name | Type | Description |
|---|---|---|
aURL | const string | Absolute URL of the target resource. |
Response body received from the server, decoded as a string. (string)
procedure RequestOptions(const aURL: string;
const aResponseContent: TStream); overload;
| Name | Type | Description |
|---|---|---|
aURL | const string | Absolute URL of the target resource. |
aResponseContent | TStream | Stream that receives the response body. |
None. The response body is written to aResponseContent.
The call blocks the calling thread until the complete response has been received. When the client is not connected yet, the URL is used to open the QUIC connection first. For a non-blocking request use OptionsAsync, which delivers the reply on OnResponse.
OPTIONS asks the server which methods and capabilities the target resource supports. The answer is normally carried in the allow response header, plus the CORS access-control-allow-* headers when the request is a preflight.
The method is named RequestOptions rather than Options because Options collides with an existing identifier in Delphi and C++Builder. The asynchronous counterpart keeps the protocol name and is called OptionsAsync.
vResponse := oClient.RequestOptions('https://api.example.com/v1/users');