Using either CURL or Fiddler, I can see that my login is successful according to their specification (CURL and Fiddler both show the return of a “Location” header, which I need to parse for the next step), but because the HttpUtils library throws a WebException on the 302, so I can never get access to the underlying header/response data.
Is there some way to suppress the HttpUtils from throwing the error, so I can get access to the underlying HttpWebResponse?
Was just about to write: I have actually already disabled the redirect, and thats what triggers the issue.
I’m running this code on my machine, it fires the auth call to Procountor, which successfully auths, but when I get the response back, it seems that its routed via the system I have in the redirecturl.
If I set the AllowAutoRedirect=true (default), with the redirect url set to the system it is supposed to target, i get a response successfully (contains some html from redirecturl system, but no Location header, presumably because its been rerouted already).
If I set AllowAutoRedirect=false, so the response should come back to me (running the code on my local machine), thats when I see the exception in HttpUtls when it recieves the 302 from Procountor…
So AllowAutoRedirect show success in Fiddler whether its true or false, but if true, the Location is missing from HttpUtils, and if false, the 302 kills my C# code.