命令 curl -x POST "http://xxx" -H xxxxx -d '{\"a('c)\"}' ,c前面是个单引号,结果报")"有错,然后改成curl -x POST "http://xxx" -H xxxxx -d '{\"a(\'c)\"}' , 这样还是报一样的错,只看-d后面, 转义符好像没起作用,请大神指点。 只关注-d后面,去掉c前面那个单引号,执行就是OK的。
1.wget
wget --post-data="user=user1&pass=pass1&submit=Login" http://domain.com/path/page_need_login.php
2.curl (å¯ç´æ¥åéæ ¼å¼å请æ±ä¾å¦json)
æ交jsonæ°æ®éè¦å headerï¼å¦åé'json={"phone":"13521389587","password":"test"}â
curl -H "Content-type: application/json" -X POST -d '{"phone":"13521389587","password":"test"}' http://domain/apis/users.json
æ®é请æ±
curl $URL -d "2880[]=105&pid=2880&p=æä½³&count=1&receipt=1&poll=æ票"
ç»æArray( [2880] => Array ( [0] => 105 )
[pid] => 2880 [p] => æä½³ [count] => 1 [receipt] => 1 [poll] => æ票)
wget --post-data="user=user1&pass=pass1&submit=Login" http://domain.com/path/page_need_login.php
2.curl (å¯ç´æ¥åéæ ¼å¼å请æ±ä¾å¦json)
æ交jsonæ°æ®éè¦å headerï¼å¦åé'json={"phone":"13521389587","password":"test"}â
curl -H "Content-type: application/json" -X POST -d '{"phone":"13521389587","password":"test"}' http://domain/apis/users.json
æ®é请æ±
curl $URL -d "2880[]=105&pid=2880&p=æä½³&count=1&receipt=1&poll=æ票"
ç»æArray( [2880] => Array ( [0] => 105 )
[pid] => 2880 [p] => æä½³ [count] => 1 [receipt] => 1 [poll] => æ票)
温馨提示:答案为网友推荐,仅供参考