您的当前位置:首页正文

怎么使用curl模拟http请求

来源:华佗小知识

get方式请求:

curl 地址:端口/路由

e.g:

curl 127.0.0.1:3000/test_sql

post方式请求:

curl -X POST -d "参数名=实参&参数名=实参" 地址:端口/路由

e.g:

curl -X POST -d "username=xianwx&password=test" 127.0.0.1:3000/auth