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

126
Vistas
angular file uploader methods for http request

I'm trying to use angular-file-uploader and upload a file. in afuConfig, I want to set method to POST but in terminal I have errors.

uploadAPI:  {
      url:"https://example-file-upload-api",
      method:"POST",
      headers: {
     "Content-Type" : "text/plain;charset=UTF-8",
      },
}

it gives me this:

  The types of 'uploadAPI.responseType' are incompatible between these types.
    Type 'string' is not assignable to type '"blob" | "json" | "arraybuffer" | "text" | undefined'.

I have the same problem for using responseType too.

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

The default responseType is json. Try to assign the responseType: text explicitly

uploadAPI: {  
  url: "https://example-file-upload-api",
  method:"POST",
  headers: {
    "Content-Type" : "text/plain;charset=UTF-8",
  },
  responseType: 'text'
}
about 4 years ago · Juan Pablo Isaza Denunciar

0

try below code for headers:

httpOptions: {
  headers:{
    accept: 'application/pdf'
  }
  responseType: 'blob',
}
about 4 years ago · Juan Pablo Isaza Denunciar
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