TsgcHTTP3Client › Methods › Delete

Delete Method

Sends a synchronous HTTP/3 DELETE request to remove the target resource.

Syntax

Delete(const aURL: string): string string overload

function Delete(const aURL: string): string; overload;
NameTypeDescription
aURLconst stringAbsolute URL of the target resource.

Response body received from the server, decoded as a string. (string)

Delete(const aURL: string; const aResponseContent: TStream) stream overload

procedure Delete(const aURL: string;

  const aResponseContent: TStream); overload;
NameTypeDescription
aURLconst stringAbsolute URL of the target resource.
aResponseContentTStreamStream that receives the response body.

None. The response body is written to aResponseContent.

Remarks

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.

Example



vResponse := oClient.Delete('https://api.example.com/v1/users/1');

Back to Methods