When I make an HTTP request with the method HttpSendRequest of the WinINet API, and the response sends "302: Moved Temporarily", the WinINet API automatically follows the redirection instruction and makes a new request.
So, How to prevent HttpSendRequest to follow redirects (30x Status Codes)?
I don't want't to make two requests... I wan't to get the the first response it got with the status code 302 in it's header.
-
I found a flag
INTERNET_FLAG_NO_AUTO_REDIRECTthat I must pass toHttpOpenRequest.But, it isn't working....
-
Redirection can be prevented if you are able to use WinHTTP instead (link).
-
Try using
INTERNET_FLAG_NO_AUTO_REDIRECTin the call toHttpSendRequest. Sounds like you're trying to use it fromHttpOpenRequest.I use this flag with
InternetOpenUrl, and it works properly in that call.
0 comments:
Post a Comment