【发布时间】:2019-01-29 02:46:12
【问题描述】:
我尝试将详细信息发送到服务器但收到 403 错误
下面是我的代码。
export const updateAppTypeData = (appData) => async dispatch => {
const token = localStorage.getItem('token')
const response = await axios({
method : 'put',
url: ('http://localhost:8000/api/posts/appType/'+appData.id+'/'),
data: appData,
headers: {'Content-Type': 'application/json', 'Authorization': 'Token '+token},
json: true
}).then(function (response) {
console.log(response);
});
//dispatch({ type : FETCH_APP_TYPE , payload: response.data });
};
任何帮助都将是一大优势。谢谢。
【问题讨论】:
-
您的请求选项是正确的 IMO。
-
谢谢@Arup 但我仍然收到 403 错误。我们是否必须以其他方式放置 jwt 令牌。
标签: python django python-3.x reactjs django-rest-framework