Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

140
Views
Still getting a 200 when AllowAutoRedirect is set to false

I tried to follow an answer and this is what I have now:

var response = string.Empty;

HttpContent content = new StringContent(poststring);
content.Headers.Remove("Content-Type");
content.Headers.TryAddWithoutValidation("Content-Type", "multipart/form-data; boundary=" + boundary);

//const string contentType = "multipart/form-data; boundary=<calculated when request is sent>";

HttpRequestMessage request = new HttpRequestMessage
{
     Method = HttpMethod.Post,
     RequestUri = u,
     Content = content,
};
    
var handler = new TemporaryRedirectHandler()
{
     InnerHandler = new HttpClientHandler()
     {
         AllowAutoRedirect = false
     }
};

HttpClient client = new HttpClient(handler);
HttpResponseMessage result = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);
return result;

Problem is that I still get a 200 and when I look at my request in Fiddler I don't see the AllowAutoRdirect set to false anywhere. WHere should i capture that field to include it in the request?

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!