Hello Colleagues,
I want to set custom Host header with TIdHTTP component but I did not have luck to do is. At the moment I am trying something like:
HttpClient:=TidHTTP.Create(nil);
HttpClient.HTTPOptions := [];
Response := TStringList.Create;
success := True;
if HostHeader.Text <> '' then
HttpClient.Request.CustomHeaders.Values['Host'] := HostHeader.Text;
try
response.Text := HttpClient.Get(SrvAddrEdit.text + '?supported_flags=supported_flags');
except
ShowMessage('Cannot read from the server!');
success := False;
end;
I am using wireshark and I sniff the traffic so custom Host header is missing in http header. Maybe I am not setting it correctly.
What is the right way to set custom Host header for this http request?