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

98
Visualizações
Angular 5 HTTP failure during parsing for image

I want to get image from Express server with Angular using its filename:

Request from Angular service

And I want to send the file back to the client:

Sending file from Express server

When I log the response from the server I get the following error:

Error message from response

I am nearly sure that I am missing any options either in my request or in my response, but I am not sure what.

Any help would be highly appreciated.

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

0

HttpClient applies the 'json()' method to the response, so if your response is non-JSON data, you'll get this type of error.

Although it is the most common, you will sometimes deal with different types of data. This is supported through the responseType property.

 this.http.get('...', { responseType: 'text' }); //

response type?: 'arraybuffer' | 'stain' | 'json' | 'text'

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