【发布时间】:2019-09-03 01:01:32
【问题描述】:
我现在使用 axios 从前端使用 react js 将文件名发送到我的 DRF api 类,我需要使用 drf post 方法将该文件名发送到我的另一个 api 类并搜索文件并返回文件作为响应。
我尝试从后端进行操作,它成功了,但是当我尝试使用 post 方法发布我的文件名时,我无法做到
我使用 Django 和 drf 以及我的前端作为 react js
我的前端代码看起来像这样
fetchFile = (value) => {
const url = `${API}/dashboard/log_file/`;
const data = {
info :value
}
axios.post(url,{data}
)
};
【问题讨论】:
标签: django python-3.x reactjs django-rest-framework