常用的几种 curl操作记录一下 (其中多个请求头的时候 可以多个 -H)
1.操作示例:
curl -H "Content-type: application/json" -X POST -d '{"hisOrdNum":"38282066"}' http://127.0.0.1:13024/api/customize//his/passwordlessRefund
2.操作示例:
curl http://127.0.0.1:13024/api/customize/getHisPatAccBind X POST -d 'openId=o5Jx4vxHrOKnu-bMrQYetaS7p2k4&patIdNo=430104192906044326'
3.操作示例:
curl http://192.168.100.45:8095/Service.asmx -X POST -H "Content-Type:text/xml" -d '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:car="http://cardtest.com/"><soapenv:Header/><soapenv:Body><car:Process><car:transCode>0227</car:transCode><car:xml><![CDATA[<Request><Date>99990101</Date><TimeRang>3</TimeRang><OfficeID>S088</OfficeID><DoctorCode></DoctorCode></Request>]]></car:xml></car:Process></soapenv:Body></soapenv:Envelope>'
4.操作示例:
curl -H "Content-Type:application/json" -X POST --data '{"hisId":234,"platformSource":3,"subSource":2}' http://localhost:20409/hisauthorize/refreshcache
本文详细记录了几个使用curl进行HTTP请求的示例,涉及POST方法、不同内容类型(如JSON和XML)、以及多个请求头的处理,展示了在API开发中常见的请求格式和参数传递方式。

962

被折叠的 条评论
为什么被折叠?



