I have a problem with TScHttpWebRequest.
When I call GetResponse from a webservices returning status code 403, I get an exception telling me that this code has been return. But I have no way of getting the data send with this status code?
If I call TScHttpWebRequest's ReadBuffer I only get what I did send
Is there anyway to avoid the GetResponse raise an exception, which is not a logical solution in my opion. Or at lease get the data send from the webservice?
TScHttpWebRequest and GetResponse Exception
Re: TScHttpWebRequest and GetResponse Exception
When the server returned an error status 403 and there is some additional information, then to access this information, you can use the HttpException.ServerMessage property. For example:
Code: Select all
try
Response := Request.GetResponse;
except
on E: HttpException do
if HttpException(E).StatusCode = scForbidden then
s := HttpException(E).ServerMessage;
end;
Re: TScHttpWebRequest and GetResponse Exception
Thank you - works great.
BTW: ServerMessage is not documentet in the help for HttpException
BTW: ServerMessage is not documentet in the help for HttpException
Re: TScHttpWebRequest and GetResponse Exception
It is good to see that the problem has been solved.
Thank you for the information. We will add the necessary information in SecureBridge help in the next version of SecureBridge.
Feel free to contact us if you have any further questions about our products.
Thank you for the information. We will add the necessary information in SecureBridge help in the next version of SecureBridge.
Feel free to contact us if you have any further questions about our products.