TsgcHTTP3Client › Methods › Delete
Sends a synchronous HTTP/3 DELETE request to remove the target resource.
function Delete(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 Delete(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 DeleteAsync, which delivers the reply on OnResponse.
DELETE asks the server to remove the target resource and carries no request body. Many APIs answer with 204 No Content and an empty body, so inspect the status code rather than the returned string to decide whether the call succeeded. Read the status from OnResponse or use Head to confirm the resource is gone.
vResponse := oClient.Delete('https://api.example.com/v1/users/1');