Hello Mike,

Can you please start a new thread if you do so instead of hit reply ?
Many email readers can sort on thread, so if you do so people that are
not interested in the thread where you reply to will never see your

About your question. You have to put the second code after the first is
done. That is when onRequestDone is fired with ready state.

I have remove the follow-up so this answer will appear as a new thread.

Rgds, Wilfried [TeamICS]

Thursday, July 26, 2007, 19:19, Mike Sutton wrote:

> I sent the following to the list about a month ago, but no-one ever
> replied. I'm not sure it that means no-one's interested or no-one saw
> the message:

> I've noticed this in both V5 and V6 beta:

> The problem:
> HTTPCli.UserName := '';
> HTTPCli.Password := '';
> HTTPCli.URL := 'http://server.com/members';
> HTTPCli.GetAsync;

> Returns 401 Authentication required.
> Using the same instance of HTTPCli as above (Ie after the above code):
> HTTPCli.UserName := 'username';
> HTTPCli.Password := 'password';
> HTTPCli.URL := 'http://server.com/members';
> HTTPCli.GetAsync;

> Returns a StatusCode of 0.

> This is due to some data being left in ReceiveBuffer (or rather,
> ReceiveLen not being reset to zero). The first header line of the
> second call is added after the spurious data, and the status code is
> therefore in the wrong place in the buffer.

> I've got a work around, by placing
> ReceiveLength := 0;
> in InternalClear, but I don't understand the authentication part of
> the code well enough to know how to fix it properly.

> Mike

To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to