Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

248
Visualizações
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.

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

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'
}
over 4 years ago · Santiago Trujillo Relatório

0

try below code for headers:

httpOptions: {
  headers:{
    accept: 'application/pdf'
  }
  responseType: 'blob',
}
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda