Failure in IDCustomHTTPServer in Delphi 2009

Giganews Newsgroups
Subject: Failure in IDCustomHTTPServer in Delphi 2009
Posted by:  Andreas Kr├╝mberg (andre…@pcdata.co.uk)
Date: Fri, 16 Jan 2009

As i mentioned  below, I have a problem using the IDHTTPWebBrokerBridge
under Delphi 2009.

The content of the HTTPRequest is empty and so I get an XML exception.

The content is read from the UnparsedParams property.
In the IDCustomHTTPServer Code delivered with Delphi 2009 I found this code.

              // reset back to 0 before reading the string from the post
stream
              LRequestInfo.PostStream.Position := 0;
              if TextIsSame(LRequestInfo.ContentType,
'application/x-www-form-urlencoded') then begin    {Do not Localize}
                LRequestInfo.FormParams :=
ReadStringFromStream(LRequestInfo.PostStream);
              end;

              // reset back to 0 for the OnCommand... event handler
              LRequestInfo.PostStream.Position := 0;
              LRequestInfo.UnparsedParams := LRequestInfo.FormParams;

The UnparsedParams property is only filled when contentype equals
'application/x-www-form-urlencoded', but using the HTTPWebBrokerBridge for a
Webservice
the contentType is 'text/xml; charset="utf-8"'.

So I donät understand this inserted line of code. Why is there a check on
the contenttype.

And what shall I do to get a clean solution for my problem.

Thanks

Andreas

Replies