There has been a change to the HTTPRIO.HTTPWebNode.OnBeforePost
event in Delphi 10.3.
Before Delphi 10.3, the event handler was defined this way, and it worked perfectly:
procedure TForm1.HTTPRIO1HTTPWebNode1BeforePost(const HTTPReqResp: THTTPReqResp;
Data: Pointer);
var
auth: String;
begin
auth := 'Authorization: Basic ' + IdEncoderMIME1.EncodeString('user:password');
HttpAddRequestHeaders(Data, PChar(auth), Length(auth), HTTP_ADDREQ_FLAG_ADD);
end;
In Delphi 10.3, the Data
parameter is gone, instead a THTTPClient
is given, and I have no idea how to implement Basic authentication with it:
procedure TForm1.HTTPRIO1HTTPWebNode1BeforePost(const HTTPReqResp: THTTPReqResp;
Client: THTTPClient);
var
auth: String;
begin
auth := 'Authorization: Basic ' + IdEncoderMIME1.EncodeString('user:password');
???
end;
Any hints?