D
D
D55RUS2020-06-30 12:10:17
Python
D55RUS, 2020-06-30 12:10:17

How to pass Request Payload to request?

The very essence: I'm trying to make a bot for buying on this site. To buy a thing, you need to make such a request, but I don’t know how to send Request Payload. I read the documentation, it didn’t really help, I would like any example to understand. Here is the screenshot:5efb016223748218004016.jpeg

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
ScriptKiddo, 2020-06-30
@D55RUS

payload = {
        "game": "csgo",
...
    }

r = requests.post('xxx.com', data=payload)

Or copy from the browser to CURL:
img

5ef7ca08f108d753576451.png

Then convert with curl.trillworks.com

C
cython, 2020-06-30
@cython

If you are using requests, then the requests.post function has an optional data parameter, which contains the request payload.
An example from the documentation for passing JSON to payload:

payload = {'key1': 'value1', 'key2': 'value2'}
r = requests.post("https://httpbin.org/post", data=payload)
print(r.text)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question