Answer the question
In order to leave comments, you need to log in
Requests POST request error in Python. Where is the mistake?
I want to send a POST request, the same as on the first and second screens, to get a list of goods.
When requesting, I pass payload (the first line in the console), and I get the answer "invalid parameter" (through the line). On the last screen is an example of what answer I should get. Please tell me what's wrong
Console -
{ "tradeType":0,"currency":"","amountFrom":"","amountTo":"","reSale":"","keyword":""," orderBy":"amount_sort","orderType":1,"page":1,"rows":16,"collectionId":"535663017148645377" }
{ "code":"000002","message":"illegal parameter" ,"messageDetail":null,"
Answer the question
In order to leave comments, you need to log in
Output - document.write(); or document.getElementById(...).innerHTML = "...";
Lack of length - you have not an array, but a list (hash).
datad needs to be passed to the json parameter:
datad = { "tradeType":0,"currency":"","amountFrom":"","amountTo":"","reSale":"","keyword":"","orderBy":"amount_sort","orderType":1,"page":1,"rows":16,"collectionId":"535663017148645377" }
temp = requests.post("https://www.binance.com/bapi/nft/v1/friendly/nft/layer-product-list", json=datad)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question