curl 模拟 post 访问

Posted on Posted in command

curl 模拟 post 访问

curl post 表单

curl -d "param1=value1&param2=value2" -X POST http://localhost
curl -d "param1=value1&param2=value2" -H "Content-Type: application/x-www-form-urlencoded" -X POST http://localhost
curl -d "@data.txt" -X POST http://localhost

cat data.txt
param1=value1&param2=value2

curl post json

curl -d '{"key1":"value1", "key2":"value2"}' -H "Content-Type: application/json" -X POST http://localhost
curl -d "@data.json" -X POST http://localhost

cat data.json
{
  "key1":"value1",
  "key2":"value2"
}
» 转载请注明来源:呢喃 » curl 模拟 post 访问

Leave a Reply

Your email address will not be published. Required fields are marked *

17 − one =