TsgcHTTP2Client › Methods › Trace
Performs a synchronous HTTP/2 TRACE request used to debug the request path between client and server.
function Trace(Const aURL: string): string;
| Name | Type | Description |
|---|---|---|
aURL | const string | Absolute URL to target. The request headers (potentially modified by proxies in the path) will be echoed back by the origin server. |
Response body containing the echoed request, as a message/http document. (string)
TRACE performs a message loop-back test: the server replies with the exact request line and headers it received, making it useful for diagnosing which proxies or gateways alter traffic. Many servers disable TRACE for security reasons, so be prepared to receive 405 Method Not Allowed.
vEcho := oClient.Trace('https://api.example.com/diag');
procedure Trace(Const aURL: string; const aResponseContent: TStream);
| Name | Type | Description |
|---|---|---|
aURL | const string | Absolute URL to target with the TRACE request. |
aResponseContent | const TStream | Stream that captures the echoed message/http response body. |
Stream-based overload. Convenient when the echoed request is long (for example when many proxy via headers have been added) and you prefer to persist it to disk or a memory buffer for later analysis.
oOut := TFileStream.Create('trace.log', fmCreate);
try
oClient.Trace('https://api.example.com/diag', oOut);
finally
oOut.Free;
end;