TsgcHTTP2ClientMethods › Head

Head Method

Performs a synchronous HTTP/2 HEAD request, returning only the response headers without any body.

Syntax

procedure Head(const aURL: string);

Parameters

NameTypeDescription
aURLconst stringAbsolute URL whose metadata (status, length, content type, cache validators) should be retrieved.

Remarks

HEAD is identical to GET except that the server must not return a message body. It is useful for checking resource existence, reading content-length or last-modified, or validating cache entries without paying the cost of the full download. The response headers become available on Request.Headers once the call returns.

Example

oClient.Head('https://api.example.com/download/large.bin');
vSize := oClient.Request.Headers.Values['content-length'];

Back to Methods