Sample code for 30+ languages & platforms
Delphi ActiveX

Example: Http.HttpNoBody method

Demonstrates how to use the HttpNoBody method to send HTTP requests without a request body (e.g., GET, DELETE, HEAD) and receive the response in a Chilkat Http response object.

Chilkat Delphi ActiveX Downloads

Delphi ActiveX
uses
    Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
    Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Chilkat_TLB;

...

procedure TForm1.Button1Click(Sender: TObject);
var
success: Integer;
http: TChilkatHttp;
resp: TChilkatHttpResponse;
url: WideString;

begin
success := 0;

http := TChilkatHttp.Create(Self);
resp := TChilkatHttpResponse.Create(Self);

// Send a DELETE request to https://api.example.com/users/123
url := 'https://api.example.com/users/123';
success := http.HttpNoBody('DELETE',url,resp.ControlInterface);
if (success = 0) then
  begin
    Memo1.Lines.Add(http.LastErrorText);
    Exit;
  end;

Memo1.Lines.Add('Response Status Code: ' + IntToStr(resp.StatusCode));
Memo1.Lines.Add('Response body:');
Memo1.Lines.Add(resp.BodyStr);
end;