Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Read HTTP Header Field "Host"
#4
Hi, you have information you can handle like this:
uses
  IW.HTTP.Request

Code:
procedure TIWServerController.IWServerControllerBaseNewSession(aSession: TIWApplication);
begin
   ASession.Data := TIWUserSession.Create(nil, aSession);

   { Use ASession.Request to obtain a lot of information }
   if ASession.Request.HttpMethod = hmNone then begin
      ASession.Response.Code     := 405;
      ASession.Response.CodeText := 'Not Allowed';
      ASession.Terminate;
   end;
end;
Reply


Messages In This Thread
Read HTTP Header Field "Host" - by RosenbergFans - 11-05-2019, 08:37 AM
RE: Read HTTP Header Field "Host" - by Jose Nilton Pace - 11-06-2019, 02:12 PM
RE: Read HTTP Header Field "Host" - by kudzu - 11-19-2019, 02:10 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)