Sandro
1
I’m trying to make a POST request to pause synching, but when I run it return me 403 error code
this is the code
import requests
data = {"X-API-Key": "key"}
url = "http://localhost:8384/rest/system/pause"
response = requests.post("http://localhost:8384/rest/system/pause", data)
print(response)
calmh
(Jakob Borg)
2
It looks like you’re sending the API key as body data, while it should be a header.
1 Like
Sandro
4
sorry for the ignorance, concretely how can I do that? s
You should refer to the documentation of the library you are using, as the question has nothing todo with syncthing, but usage of the library.
wweich
6
requests has been deprecated for a while and shouldn’t be used anymore. None the less: docs
Never mind, looked like node.js to me (after a quick look)
This looks like python, and I don’t think that is deprecated.
martinleben
(Martin Leben)
8
No, but request (without the ending s) has been deprecated. OP wrote requests though.
system
(system)
Closed
9
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.