【发布时间】:2020-01-31 11:00:45
【问题描述】:
export default myAPI = axios.create({
baseURL: 'myapiurl',
// headers for post reuqest
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
Accept: 'application/json',
'X-CSRF-TOKEN': 'o987WyyzM7ktyEVzP4dakCdIY12LprtJU8qZHs5Xs0s',
},
// headers for get requests
headers: {
'Content-Type': 'application/json',
Accept: 'application/json',
},
});
基本上需要根据天气发布或获取请求的条件标头。
【问题讨论】:
-
请明确提及您面临的与此相关的问题
标签: javascript react-native asynchronous axios fetch