Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

96
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!