Unable to set timeout for HTTPClient.
peilun-conflux opened this issue · comments
Sorry, I didn't find the proper way to set the timeout for HTTPClient
and is currently hacking requests
to achieve this.
Is it not supported yet or am I missing any feature?
You can't with request
(or notify), but you can with send
:
client.send(Request("ping"), timeout=10)
Hi @bcb
I am also trying to set a timeout for this call: response = request("http://" + ipEntry.get() + port, "temperature_test", x)
.
Now I tried: response = client.send(request("http://" + ipEntry.get() + port, "temperature_test", x), timeout=10)
but I get the errormessage: NameError: name 'client' is not defined. Which module do I need to import to get this work? I am thankful for any hints and answers. Best regards, pfra17
@pfra17 you need a capital r Request
, which is a class, not a function, shown here https://jsonrpcclient.readthedocs.io/en/latest/api.html