curl 命令

curl 命令的get方法

http://10.116.246.2/api/request/ResourceModule

curl 命令的post 方法

-H 参数 :一般的请求头加post就可以

-b 参数:-b参数后面直接跟cookie 的值,如果cookie也用post的话会提示令牌过期

-X参数:后面指请求(POST)

-d参数:参数加post请求的消息体

最后加请求的url

curl -H ‘Content-Type:application/json‘

-b ‘ang=zh; ountry=CN; active_region=d01; accessToken=f86922a3cc‘

-X POST 

 -d ‘{"content":{"pageRequest":{"size":1,"page":1},"resourceName":"bs","lang":"zh_CN"}‘

http://10.116.246.2/api/request/ResourceModule

curl -H  ‘Content-Type:application/json‘ -b ‘lang=zh; country=CN; active_region=ztcloud-d01; accessToken=f86922a3cc‘  -X POST  -d ‘{"content":{"pageRequest":{"size":1,"page":1},"resourceName":"bs","resourceInstanceQueryForm":{"attrQueryParams":{"RegionId":"cn-shanghai-ztcloud-d01"},"providerName":"aliyunPrivate"}},"lang":"zh_CN"}‘   http://10.116.246.2/api/aliyun/resources/request/

相关推荐