Pyspider, how does POST submit request payload, that is, JSON information?

this is a very troublesome question

the URL is https://alphaliner.axsmarine.

the post information to be submitted is
[{"action": "top100", "method": "getTop100Table", "data": null, "type": "rpc", "tid": 1}, {"action": "top100", "method": "getTextCalculations", "data": null, "type": "rpc", "tid": 2}]

it"s easy to use the requests library. There"s a json parameter in it, and I can also use it directly in pyspider. It"s no big deal. It can also be submitted in the form of data = json.dumps (data).

the data parameter of the crawl method in question pyspider, if you enter json.dumps (data), you can"t climb it. After thinking about it, I think that this should be due to the lack of basic functions, right?

Sep.17,2021
The content sent by

POST is a string. All you have to do is do everything you can to construct the same string

.
Menu