'HttpEndRequest'에 해당되는 글 1건

  1. 2009.09.09 Something worth knowing about HttpEndRequest by Dansoonie
It's not something MAJORLY important, but I thought it is worth knowing it.

I just found out that by the time when HttpEndRequest completes, the header of the response is already available. Which means, you are able to call HttpQueryInfo on the resource handle(handle obtained from HttpOpenRequest()) for further actions.

Was this something obvious?
Because, the MSDN description of HttpEndRequest is nothing more than this
Ends an HTTP request that was initiated by HttpSendRequestEx.

I didn't know this until now. I came to learn about this fact by reading and article on how to "How to use HttpSendRequestEx with password-protected URLs." The following is an excerpt from the article where I have been able to realize the fact.
Unlike HttpSendRequest, HttpSendRequestEx will not resubmit a request on its own after receiving the "401 Access Denied" status code from the server. Therefore, HttpEndRequest will fail with an ERROR_INTERNET_FORCE_RETRY error.

Great !!! I have learned something. However, I don't think that HttpEndRequest fails with ERROR_INTERNET_FORCE_RETRY error upon receiving "401 Access Denied" status code when network is supposed to behave asynchronously.

Ah... the frustration...
Microsoft should put more effort in making their document more complete if their API's lack consistency. Right??? I'm I missing something???
Posted by Dansoonie