作者ymps3502 (chaney)
看板Ajax
標題[問題] 請教ajax問題
時間Fri Sep 1 11:59:55 2017
目前嘗試用laravel + vue.js寫網頁
邊看影片邊學習
看到此處時有一些疑惑
https://youtu.be/2pCUxZZq68I?t=8m7s
影片處使用axios去發送request到後端
他說為了讓laravel能分辨ajax request所以要加XMLHttpRequest到header
不過github上axios第一個features就是make XMLHttpRequests
外加我實際測試有無加header都可以從後端得到response
所以...XMLHttpRequest需要加到header嗎?
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 36.235.45.60
※ 文章網址: https://webptt.com/m.aspx?n=bbs/Ajax/M.1504238397.A.5DC.html
1F:→ freeccc: 這個 header 是安全性考量用的,不是說沒設定就拿不到資 09/01 12:47
3F:→ freeccc: 17478731/whats-the-point-of-the-x-requested-with-hea 09/01 12:47
4F:→ freeccc: der 09/01 12:47