curl 模拟http请求

发送普通Get请求

curl 'https://www.baidu.com' 

发送带有URLEncode的Get请求

curl -G --data-urlencode "name=Lu&id=131122198809042433&starttime=2016&level=大专&college=北大&usecache=false"  '127.0.0.1:9030/tools/educationsearch' 
 
  • -G表示Send the -d data with a HTTP GET (H)
  • –data-urlencode 对HTTP data url encoded

发送Post请求,使用Json数据格式

curl -H "Content-Type:application/json" -d '{ "payload":"data" }' "http://127.0.0.1:9090/seal/loanApplication"
 

除非标明,否则皆为<IT民工の在日生活 - 神户印象>原创之作,转载必须以明文链接标明出处。
本文链接:https://www.lifeinjp.net/share/linux/168

发表评论