Languages

JavaScript - how to set axios response type?

3 points
Asked by:
Kenya-Spears
860

How can I set axios response type?

I am using axios.post() method to send request data and I wanted to set the response type to blob.

I need something like:

1 answer
3 points
Answered by:
Admin Dirask Community
4380

You can use responseType config option to do so.

Practical example

Available responseType values:

  • 'arraybuffer'
  • 'blob'
  • 'document'
  • 'json'
  • 'text'
  • 'stream'

 

See also

  1. JavaScript - how to download file using axios? 
0 commentsAdd comment
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join