Answer the question
In order to leave comments, you need to log in
How to make an RPC request in python?
In short, there is a task. I need to make a request to the RPC server and get a json response, parse it, etc. I can't make this request in my python. I used requests lib and this one . Both return 401, although I provided authorization data. Can you tell me what I'm doing wrong?
Did it like this:
import requests
data={"rpsuser": ..., "prcpassword":..., "method": "method_name"}
requests.post("ip and port", json=data}
from jsonrpcclient import request
request("ip and port" , "method_name", rpsuser="...", prcpassword="...")
Answer the question
In order to leave comments, you need to log in
In short, I myself found the answer, the point is that authorization data is not sent to the body, but to the address.
So my request should have looked like this
import requests
requests.post("rpsuser:[email protected]:port", json={"method": method})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question