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

200
Vistas
How can I allow all setRequestHeader in Ajax?

I am developing an application where I would like to allow my setRequestHeader to accept all file types. I'm trying to send via POST two input values, one of the text type and the other of the file type, but I'm only allowing one of the two.

my code:

 var xml = new XMLHttpRequest();
 xml.open("POST", url, true);
 xml.setRequestHeader('Accept', 'multipart/form-data');
 //xml.setRequestHeader('Content-Type', 'application\/x-www-form-urlencoded');
 xml.onloadend = response;
 xml.send(send);

How can I set the setRequestHeader to allow all file types or at least the ones I need which is text and file type, is there a specific setRequestHeader for that?

about 4 years ago · Juan Pablo Isaza
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