A
A
alivergg2022-03-15 19:06:08
JavaScript
alivergg, 2022-03-15 19:06:08

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,"
6230b94e91f2b787973817.png
6230b95624113183189572.png
6230b95cae6e1467783397.png
6230b96508e1c256449860.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey, 2016-06-01
@alsopub

Output - document.write(); or document.getElementById(...).innerHTML = "...";
Lack of length - you have not an array, but a list (hash).

B
brunql, 2022-03-15
@brunql

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 question

Ask a Question

731 491 924 answers to any question