[請益] 關於php multipart curl問題請益
當我使用
curl -X POST http://localhost.com/test.php -F "a=bbbb" 時
結果:
array(1) {
["a"]=>
string(4) "bbbb"
}
抓的到POST資料
可是當我加入 -H 的資料
curl -X POST http://localhost.com/test.php -H "Cache-Control: no-cache" -H
"Postman-Token: 6e468ce3-b9e0-4502-65ff-a08eed133c55" -H "Content-Type:
multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -F
"a=bbbb"
結果:
array(0) {
}
就抓不到資料了
test.php內容:
<?php
var_dump($_POST);
想請問我的用法是哪裡有用錯??
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.34.142.39
※ 文章網址: https://www.ptt.cc/bbs/PHP/M.1431411752.A.8F6.html
推
05/12 17:34, , 1F
05/12 17:34, 1F
→
05/13 09:21, , 2F
05/13 09:21, 2F
→
05/13 09:40, , 3F
05/13 09:40, 3F
推
05/13 09:45, , 4F
05/13 09:45, 4F
PHP 近期熱門文章
PTT數位生活區 即時熱門文章