axios Content-Type
时间: 2023-09-29 16:11:10 浏览: 100
axios的Content-Type是什么类型?
回答: axios的Content-Type可以根据需要进行配置。一种常用的配置是将Content-Type设置为"application/x-www-form-urlencoded",可以通过修改axios请求头中的content-type来实现。\[1\]另外,当使用axios发送post请求时,默认的Content-Type类型是"application/json;charset=utf-8",即将json数据直接放到请求体中提交到后端。\[3\]如果需要使用multipart/form-data类型,可以在请求拦截器中进行判断并设置相应的Content-Type。\[2\]
#### 引用[.reference_title]
- *1* *3* [axios配置请求头content-type](https://blog.csdn.net/L_csdn123/article/details/122983742)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [Axios请求中Content-Type的使用总结](https://blog.csdn.net/qq_17613195/article/details/106642043)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文