05-08-2019, 10:31 AM
(This post was last modified: 05-08-2019, 12:27 PM by NevTon.
Edit Reason: ctrl+c, ctrl+v fixup
)
I've tested oryginal Indy code once more.
This line is not working:
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:
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.
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.