1. 程式人生 > >axios post提交的Content-Type設定

axios post提交的Content-Type設定

import axios from'axios';

import qs from'qs';

var data = {age: 18};

var url = '';

axios.post(url,qs.stringify(data),

{headers: {'Content-Type': 'application/x-www-form-urlencoded'}}

).then(result => {

// do something

})