Skip to content

Commit

Permalink
Fix post, put and delete
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenklar committed Aug 19, 2024
1 parent dd1de58 commit 4ba0563
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions rdmo_client/client/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ def get(self, url, params={}):
return self.parse_response(response)

def post(self, url, data):
response = requests.post(self.base_url + url, data, auth=self.auth, headers=self.headers)
response = requests.post(self.base_url + url, json=data, auth=self.auth, headers=self.headers)
return self.parse_response(response)

def put(self, url, data):
response = requests.put(self.base_url + url, data, auth=self.auth, headers=self.headers)
response = requests.put(self.base_url + url, json=data, auth=self.auth, headers=self.headers)
return self.parse_response(response)

def patch(self, url, data):
Expand Down
2 changes: 1 addition & 1 deletion rdmo_client/client/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ def update(self, resource_url, pk, data, **kwargs):

def destroy(self, resource_url, pk, **kwargs):
url = self._build_url(resource_url, kwargs, pk)
return self.delete(url) #pk included in url, thats sufficient
return self.delete(url)

0 comments on commit 4ba0563

Please sign in to comment.