5

I'm doing a POST via HttpWebRequest of Content-Type: multipart/form-data

The problem is, by default the AllowAutoRedirect is set to true, but the subsequent GET request after I get a 302 redirect from the server is still setting the Content-Type to multipart/form-data when ASP.NET automatically sends out another GET request

This is giving me issues, as the page I'm being redirected to sees the Content-Type: multipart/form-data and blows up

Is there a way to clear these headers before the redirect or anyway to control the headers being sent out in this automatic response? What are my options here?

My only other option is to set AllowAutoRedirect = false and then manually checking for a 302 code and rendering the contents manually

4

0 回答 0