1.传header参数
curl --header 'Token:40d7c342c110414888cc2a0e1284c636' "127.0.0.1/api/user/baseInfo"
或者
curl -H 'Token:40d7c342c110414888cc2a0e1284c636' "127.0.0.1/api/user/baseInfo"
2.通过Get方法请求:
curl "127.0.0.1/api/mobile/getPvHtml"
3.通过post方法请求
curl -d 'name=yyy&mobile=17782376789&detail_address=ddd' "127.0.0.1/api/mobile/memberRecommend"
4.header和post混用
curl --header 'token:d46aeada5d74196a0efa7b2a2bfa9fa' --header 'uid:13045' "api.ginlongmonitoring.com/v1/device/inverter/data?device_id=100459476&start_date=2017-07-31+14%3A54%3A50&end_date=2017-07-31+16%3A54%3A50&perpage=1&timezone_id=PRC”
curl -H "Content-Type:application/json" -X POST -d '{"header":{},"request":{"c":"position","m":"rpc/listRecommendPosition","p":{"uid":1226, "shop_id":4}}}' http://common-ats-blue.rpc/atsng/rpc
更多详见:http://blog.51yip.com/linux/1049.html