requests post parameter error

Asked 6 days ago, Updated 6 days ago, 1 views

with ssesion requests. () as s : in the door. After logging in the session cookies to be set up the state. (get, json) another page output is well.
In the case of the following page I error, a request for post.
Where's the matter?

url='https://www.esmplus.com/Sell/SingleGoodsMng/GetSingleGoodsList?_dc=1629816933189'
s.headers = {
    'Accept': '*/*',
    'Accept-Encoding': 'gzip, deflate, br',
    'Accept-Language': 'ko,en-US;q=0.9,en;q=0.8,fr;q=0.7',
    'Connection': 'keep-alive',
    'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
    'Cookie':'_ga=GA1.2.1292533393.162***************************',
    'Host': 'www.esmplus.com',
    'Origin': 'https://www.esmplus.com',
    'Referer': 'https://www.esmplus.com/Sell/SingleGoodsMng?menuCode=TDM396',
    'sec-ch-ua': '"Chromium";v="92", " Not A;Brand";v="99", "Google Chrome";v="92"',
    'sec-ch-ua-mobile': '?0',
    'Sec-Fetch-Dest': 'empty',
    'Sec-Fetch-Mode': 'cors',
    'Sec-Fetch-Site': 'same-origin',
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36',
    'X-Requested-With': 'XMLHttpRequest'
}


data = {
    'paramsData':{
        "Keyword": "Valve",
        "SiteId":"1",
        "CategorySiteId":1,
        "CategoryCode":"641009",
        "CategoryLevel":"S",
        "TransPolicyNo":502170,
        "StatusCode":"",
        "SearchDateType":1,
        "SearchStartDate":"",
        "SearchEndDate":"",
        "SellerId":"rmfrmffla",
        "SellerSiteId":"1",
        "StockQty":10,
        "SellPeriod":15,
        "DiscountUseIs":1,
        "DeliveryFeeApplyType":2,
        "OptAddDeliveryType":1,
        "OptSelUseIs":2,
        "PremiumEnd":3,
        "PremiumPlusEnd":30,
        "FocusEnd":7,
        "FocusPlusEnd":30,
        "GoodsIdType":"S",
        "GoodsIds":"",
        "ShopCateReg":1,
        "IsTPLUse":"TL",
        "SellMinPrice":"",
        "SellMaxPrice":"",
        "OrderByType":11,
        "GroupOrderByType":1,
        "IsGroupUse":"Y",
        "IsApplyEpin":"1",
        "IsConvertSingleGoods":"N" },
    'page': 1,
    'start': 0,
    'limit': 20,
    'group' : [{"property":"SingleGoodsNo","direction":"ASC"}]
}

res =  s.post(url,data=data, headers = headeres).json()
print(res)

{'Result': None, 'ResultBase': {'ReturnErrorMessage': 'Invalid JSON default format: Keyword', 'ReturnErrorCode': '999999', 'ReturnDomain': 'A', 'ActionCode': 'L'}, 'ExceptionMessage' error occurred.'}

I have attached an additional image below. The cookie in the request header was too long, so the screen was cut. If you look at the 4th preview image, the data is printed well in json format.

requests python

2022-09-20 15:12

1 Answers

It says it doesn't exist.


2022-09-20 15:12

If you have any answers or tips


© 2022 pinfo. All rights reserved.