想熟悉一下axios,從本地獲取一張圖片后,通過axios異步上傳到本地的另一個檔案夾下,那這時候的請求地址該怎么寫?
試過了“http://127.0.0.1:3000/+本地的路徑”結果不行
謝謝!

就是post請求中的URL該怎么寫
uploadFile = (e)=> {
const param = new FormData();
param.append("file", this.state.imagePreviewUrl);
const config = {
headers: { "Content-Type": "multipart/form-data" }
};
axios.post("/url", param, config).then(res => {
console.log(res);
});
};
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/283763.html
標籤:JavaScript
下一篇:html/css