Sample code for 30+ languages & platforms
Delphi ActiveX

Example: Http.GetRequestHeader method

Demonstrates the GetRequestHeader method.

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;
hdr1: WideString;
hdr2: WideString;

begin
success := 0;

http := TChilkatHttp.Create(Self);

hdr1 := 'X-CSRF-Token';
hdr2 := 'X-Example';

http.SetRequestHeader(hdr1,'Fetch');
http.SetRequestHeader(hdr2,'123ABC');

Memo1.Lines.Add(hdr1 + ': ' + http.GetRequestHeader(hdr1));
Memo1.Lines.Add(hdr2 + ': ' + http.GetRequestHeader(hdr2));

// Output:

// X-CSRF-Token: Fetch
// X-Example: 123ABC
end;