原始参数:
[Asm] 纯文本查看 复制代码{
"pageSize": 20,
"useNewPage": true,
"addressVO": {
"cityName": "",
"countryName": "",
"districtName": "",
"provinceName": ""
},
"storeInfoVOList": [
{
"storeType": 32,
"storeId": 9991,
"storeDeliveryAttr": [
10
]
},
{
"storeType": 256,
"storeId": 6758,
"storeDeliveryAttr": [
2,
3,
4,
5,
6,
9,
12,
13
]
},
{
"storeType": 2,
"storeId": 6505,
"storeDeliveryAttr": [
7
]
},
{
"storeType": 4,
"storeId": 6672,
"storeDeliveryAttr": [
3,
4
]
},
{
"storeType": 8,
"storeId": 9992,
"storeDeliveryAttr": [
1
]
}
],
"uid": "181870804050",
"pageNum": 1,
"useNew": true,
"isReversOrder": false,
"isFastDelivery": false,
"recommendFirstCategoryId": 34118,
"recommendSecondCategoryId": 111040,
"frontCategoryIds": [
114051
]
}
[Asm] 纯文本查看 复制代码headers = {
"User-Agent": "okhttp/4.8.1",
"Connection": "Keep-Alive",
"Accept-Encoding": "gzip",
"Content-Type": "application/json",
"system-language": "CN",
"device-type": "android",
"tpg": "1",
"app-version": "5.0.93",
"device-os-version": "12",
"device-name": "Samsung_SM-S9080",
"longitude": "114.011671",
"latitude": "22.544368",
"sny": "c",
"rcs": "1",
"spv": "1.1",
"Local-Longitude": "0.0",
"Local-Latitude": "0.0"
}
url = "https://api-sams.walmartmobile.cn/api/v1/sams/goods-portal/grouping/list"
data = {"pageSize":20,"useNewPage":'true',"addressVO":{"cityName":"","countryName":"","districtName":"","provinceName":""},"storeInfoVOList":[{"storeType":32,"storeId":9991,"storeDeliveryAttr":[10]},{"storeType":256,"storeId":6758,"storeDeliveryAttr":[2,3,4,5,6,9,12,13]},{"storeType":2,"storeId":6505,"storeDeliveryAttr":[7]},{"storeType":4,"storeId":6672,"storeDeliveryAttr":[3,4]},{"storeType":8,"storeId":9992,"storeDeliveryAttr":[1]}],"uid":"181870804050","pageNum":1,"useNew":'true',"isReversOrder":'false',"isFastDelivery":'false',"recommendFirstCategoryId":34118,"recommendSecondCategoryId":113074,"frontCategoryIds":[111048]}
response = requests.post(url,headers=headers,json=data).json()
pprint.pprint(response)
模拟器中请尔都正常,但是用Python模拟就会报参数错:
[Asm] 纯文本查看 复制代码{'clientIp': '134.175.221.164',
'code': 'INTERNAL_ERROR',
'data': None,
'errorMsg': '',
'ignoreError': None,
'msg': '服务器异常,请稍后再试·',
'requestId': 'as|46e5b337c4374e9291a58a30106927f2.297.17080574481566328',
'rt': 0,
'success': False,
'traceId': '46480398987486aa'}