TsgcHTTP3Client › Methods › Head
Sends a synchronous HTTP/3 HEAD request and returns the response object with the status and headers.
function Head(const aURL: string): TsgcHTTP3Response;
| Name | Type | Description |
|---|---|---|
aURL | const string | Absolute URL of the resource whose headers are requested. |
The response object, exposing the status code and the response headers. (TsgcHTTP3Response)
HEAD requests only the metadata of a resource: the server returns the status and headers but no body, exactly as it would for a Get on the same URL. Use it to check whether a resource exists, to read its content-length or content-type, or to test cache validators without transferring the payload.
The call blocks until the response has been received and returns a TsgcHTTP3Response whose StatusCode and Headers are populated. Unlike the other verbs, Head returns the response object itself rather than a string, and it has no asynchronous counterpart and no stream overload.
oResponse := oClient.Head('https://api.example.com/v1/file.bin');
ShowMessage(IntToStr(oResponse.StatusCode));
ShowMessage(oResponse.Headers.Values['content-length']);