Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IdHTTP corrections when proxy is used
#5
I've tested oryginal Indy code once more.
This line is not working:

Code:
raise EIdHTTPProtocolException.CreateError(LResponseCode, FHTTP.ResponseText, ReadStringAsCharset(LTempStream, FHTTP.Response.CharSet));

LResponseCode is 407 - it is OK,
FHTTP.ResponseText - it is EMPTY (should be "Authentication Required" message or similar),

ReadStringAsCharset(LTempStream, FHTTP.Response.CharSet) - resturns empty string ALWAYS,
FHTTP.Response.CharSet - returns EMPTY charset ALWAYS.


I think that bug reported by me earlier was this one, sorry for making noise.


If You correct the line, to this:
Code:
raise EIdHTTPProtocolException.CreateError(LResponseCode, Response.ResponseText, ReadStringAsCharset(LTempStream, Response.CharSet));

than Exception.Message is set, but still no content is available in EIdHTTPProtocolException(E).ErrorMessage.

It seems that I was confused and was getting flag LDiscardContent as responsible for emptying ErrorMessage field, my bad.
Seems that, to fill ErrorMessage field, it needs more digging to discover the reason, why it is not set at this time.
Reply


Messages In This Thread
IdHTTP corrections when proxy is used - by NevTon - 04-29-2019, 01:17 PM
RE: IdHTTP corrections when proxy is used - by NevTon - 05-08-2019, 10:31 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)