0
使用axios。我的get方法正在工作,但post方法顯示cors錯誤。並獲得chome-> networs->頭axios,api,laravel得到:get方法正在工作..但對於post方法cors錯誤
axios.get('http://127.0.0.1:8000/api/login', {
params : {
username:username,
password:password,
}
})
.then(function(response) {
console.log(response)
})
.catch(function(error) {
console.log(error)
})
頁眉響應不同的響應頭爲獲得職位
Access-Control-Allow-Origin *
Access-Control-Allow-Methods POST, GET, OPTIONS, PUT, DELETE
Access-Control-Allow-Headers
Content-Type, X-Auth-Token, Origin
頭響應
Allow POST
Access-Control-Request-Method POST
Access-Control-Request-Headers content-type
幫我PLZ .....
感謝ü....它的作品 – priya