【发布时间】:2019-05-09 01:59:18
【问题描述】:
我正在尝试构建我的axios 以便能够模仿邮递员的请求,但失败了。请帮忙看看
const ax = axios.create({
timeout: 30000,
headers: {
'content-type': 'application/x-www-form-urlencoded'
}
});
// Attempt register operation
ax.post('https://url/5bc9ff9628d79b6d274165da/update.json', {
body: JSON.stringify({
json: JSON.stringify({ "stat": "Delivered" })
})
})
.then(({ data }) => {
console.log('DEBUG::success!!! data::', data);
})
.catch((err) => {
console.log('DEBUG::err', err);
});
【问题讨论】:
-
你也能显示标题截图吗
-
@Goldy:请看一下。剩下的两个密钥将被隐藏,因为它是一些我认为在这个问题中不需要的密钥
标签: reactjs api react-native axios postman