Commit 53bbd232 authored by Jakob Lerch's avatar Jakob Lerch
Browse files

replace get with post request in pad.py

parent 7b4d4b4f
......@@ -38,14 +38,15 @@ class Etherpad(Pad):
"&padID=" + self.pad_id)
if not r.json()["code"] == 0:
assert False
raise Exception(r.json()["message"])
return r.json()["data"]["text"]
def write(self, string: str) -> None:
r = requests.get(self.main_url + "/api/1/setText?apikey=" + self.api_key +
"&padID=" + self.pad_id + "&text=" + string)
r = requests.post(
url=self.main_url + "/api/1/setText?apikey=" + self.api_key +
"&padID=" + self.pad_id,
data={"text": string})
if not r.json()["code"] == 0:
raise Exception(r.json()["message"])
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment