你是想做测试吧,去下载一个postman吧
试试把要POST
的数据保存在json
文件中,例如 itemdata.json:
{
"nType":"1",
"nBaoYou":"0",
"szItemId":"536347062406",
"title":"秋冬新款女装韩版半高领毛 衣女加厚修身显瘦长袖套头针织衫打底衫",
"secondTitle":"",
"imgURL":"http://img4.tbcdn.cn/tfscom/i1/TB1OniJLXXXXXXzXpXXXXXXXXXX_!!0-item_pic.jpg",
"promotionTxt":"限时秒杀价",
"fOldPrice":"108",
"fThirdPrice":"0",
"fCommissionPer":"10.5",
"fCommission":"2.08",
"nTgCount":"0",
"nSellCount":"37",
"fPingFen":"0",
"nPingjiaCount":"5",
"szTgURL":"",
"szWebTgURL":"",
"szBlogTgURL":"",
"shortUrl":"",
"szDesc":"",
"nick":"艾伦圣玛旗舰店",
"coupon":""
}
在Headers
中设置Content-Type
为application/json
然后执行以下命令:
curl http://localhost:3000/api/licenses/eee -H "Content-Type: application/json" -X POST --data @itemdata.json
可以对数据编码后传输。
用firefox看看人家传的什么,用的什么header,照准了填上去,我就这么干
要保证shell和php的编码一致