Set the content-type header and use POST, which the ACME spec requires

This commit is contained in:
Alex Gaynor
2014-11-18 09:15:36 -08:00
parent a9e0028007
commit bcda03d948
+5 -1
View File
@@ -478,7 +478,11 @@ class Client(object):
try:
json_encoded = json.dumps(json_obj)
acme_object_validate(json_encoded)
response = requests.get(self.server_url, data=json_encoded)
response = requests.post(
self.server_url,
data=json_encoded,
headers={"Content-Type": "application/json"},
)
body = response.content
acme_object_validate(body)
return response.json()