0

My system Browser (IE) is proxy authenticated. I tried to download "www.google.com" using IWinHttpRequest it fails with status code 407 ( Need Proxy Authentication ) even after setting the user name and password using SetCredentials(...) for "www.google.com". The response text contains "cache access denied". How to solve this?

Alexis King
  • 43,109
  • 15
  • 131
  • 205

1 Answers1

0

SetCredentials should be called twice as follows

hr = pIWinHttpRequest->SetCredentials(bstrUserName, bstrPassword, HTTPREQUEST_SETCREDENTIALS_FOR_SERVER);
hr = pIWinHttpRequest->SetCredentials(bstrUserName, bstrPassword, HTTPREQUEST_SETCREDENTIALS_FOR_PROXY);

before called "Send"

Joachim Sauer
  • 302,674
  • 57
  • 556
  • 614