# coding = utf-8 import requests import json host = "http://47.XX.XX.XX:30000" endpoint=r"/api/v1/carXX/addCarXX" url = ''.join([host,endpoint]) headers = \ { "X-Member-Id": "23832170000", "X-Region": "1100000", "X-Channel": "01", "Content-Type": "application/json;charset=UTF-8" } body = \ { "designerId": "1111", "itemQuantity": 1, "sku": "000100000" } r = requests.post(url,headers=headers,data=json.dumps(body)) #r = requests.post(url,headers=headers,json=body) print r.text print r.url
python requests.post带head和body
最新推荐文章于 2024-07-06 02:46:51 发布