有的關(guān)于人只知道delete方法,傳值的請求時(shí)候,將請求值放在url上,方法而像post方法那些,關(guān)于帶有請求體,請求卻不知道該如果傳值。方法
首先,關(guān)于de(╯°□°)╯︵ ┻━┻le(╯°□°)╯︵ ┻━┻te方法有三種寫(xiě)法
一:請求參數拼接在url上
axios.delete('/delete',請求 {
params: { // 請求參數拼(′?`)接在url(╬?益?)上
id: 12
}
}).then(res => {
con(╬?益?)sole.log┐(′д`)┌(res)
})
二:請求參數放(′?`)在請求體
}
}).then(res => {
co??nsole.log(res)
})
三:請求??參數拼接在url上或請求參數放在請求體
axios({
method: 'delet??e',
url: '/delete',
params: { }, // 請求參數拼接在url上
data: { } // 請求參(???)數放在請求體
}).then(res => {
console.log(res)
})
文章來(lái)源:田珊珊個(gè)人博客
來(lái)源地址:http://www.tians???han277.com/796.html
(作者:百度SEO工具)