Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why is the "URL" property blank in the "TWebRequest"?

Status
Not open for further replies.

djjd47130

Programmer
Nov 1, 2010
480
US
I'm using Delphi XE2, Indy 10, and a TIdHTTPWebBrokerBridge. In the web module, requests are handled via TWebRequest and TWebResponse objects. I need to read the full complete URI which was sent from the client, but in the TWebRequest, the only relevant property, URL, returns empty. Why is this empty and how can I get the full URI?

JD Solutions
 
Trying your luck here since you didn't get a response on SO eh? :)
Anyway, If I were you, debug the application after a request and drill down to the Indy source code and see if Indy is filling in the data you need.
I took a look a the Indy source code and it seems itis merely a wrapper for the Borland webbroker.
So I'm not certain if this is even possible.

/Daddy

-----------------------------------------------------
Helping people is my job...
 
I tried tracking the reading of the URL property and wound up getting confused how this actually works internally, got stuck at:

Code:
function GetStringVariable(Index: Integer): AnsiString; virtual; abstract;

Where Index = 1

But this is an abstract function...?




JD Solutions
 
Ah Ha! In IdHTTPWebBrokerBridge.pas...

Code:
function TIdHTTPAppRequest.GetStringVariable(Index: Integer): AnsiString;
...
  case Index of
    ...
    INDEX_URL: Result := AnsiString(''); // Root - consistent with ISAPI which return path to root

So Indy is leaving this field blank for some reason...

JD Solutions
 
And just above that is a commented line:

Code:
    //INDEX_URL             : Result := AnsiString(FRequestInfo.Document);

JD Solutions
 
It seems that they do this for consistency with ISAPI.
Maybe add your own variable?

/Daddy

-----------------------------------------------------
Helping people is my job...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top