首页 > 代码库 > curl增加多个头的方法

curl增加多个头的方法

 

curl命令通过-H ‘...‘ -H ‘...‘这样增加多个头

例如:

curl -H ‘content-type: text/xml‘ -H ‘Authorization:OMPAUTH realm="OMP",appid="11110000000100018010",pid="00000",channelid="99999999999999999999",encrypteddeviceid="xSWp2OHoLbQjH2K+QCIIj13CpkwLvs2OBx4Lprx9u/9JANI5QcMusZvUOmvuM5L3",devicetoken="ArtjYy/qmyAMAW7PWa7+u9YYNk8h8x9zbMv2hMyaz4M=",ttoken="",keystoremac="fqqO+rxtCNtKA5E+a5k/Qhy3f6ZeDe7TOfN151X8XM0=",dexsignmac="8mpy5KcoHeauuyqBnUu34/zmJWJnHHRqJFF8bPdOAKI=",apksignmac="ooFG6WG3wvukhF7rDeivtoUSuFJ/G09ckg3zTOYsuT0=",counter="29",sdkversion="3",sidSignature=""‘ -H ‘OmpToken:dVavppxWRw+Thv+xkt7lqgu33zs6Sji415V4zml53L6rIsXYtHXTYKyWGc7c67Fn‘ -H ‘OmpImei:bMJed1szDbu2giIYx9UioA==‘ -H ‘OmpImsi:gsTowSc5xddTtk+xTwsFqA==‘ -H ‘OmpTID:ZwYGLCRahzBZMAhF0kjrT3tcK7rta1kMuKwAFSY265tJibjkwANd9EC9ohuxdTNW‘ -H ‘OmpServiceID:sd/ZDEl2u7+d3yvF7kWuo4auooMhQpdvuctKtyrp+IE=‘  -d ‘<?xml version=‘1.0‘ encoding=‘UTF-8‘ standalone=‘yes‘ ?><head><msgType>trusted4SubscribeReq</msgType><version>1.0</version></head><request><msgType>trusted4SubscribeReq</msgType><version>1.0</version><sessionId>11188262619412014111911001300321</sessionId><bizId>11</bizId><payCode>30000150368401</payCode><appId>11110000000100018010</appId><subsNumb>1</subsNumb><checkId>0</checkId><checkAnswer></checkAnswer><payWay>1</payWay><payPwd>123456</payPwd><randomPwd></randomPwd><channelId>99999999999999999999</channelId><userType>1</userType><netInfo>GPRS</netInfo><imsi>4J3105437Q</imsi><imei>3HTL0C910O</imei><pId>00000</pId></request>‘ "http://10.1.3.203:28900/acs/2.0/Assurance/2.0/Trusted4Subscribe"

curl增加多个头的方法