Answer the question
In order to leave comments, you need to log in
Why is it giving a 400 requests python (api) error?
Hello, I'm writing a simple script and I can't figure out how to work with api json.
API:
Code:
params = {
"number_of_cycles": 1,
"phone": "+38xxxxxxxxxx" # свой номер скрыл,и ошибки тут не должно быть
}
print(params)
print(requests.post("http://127.0.0.1:9000/attack/start", data=params))
Answer the question
In order to leave comments, you need to log in
requests.post("http://127.0.0.1:9000/attack/start", data=json.dumps(params))
# или с версии 2.4.2
requests.post("http://127.0.0.1:9000/attack/start", json=params)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question