Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

145
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda