Commit 8124bd52 authored by Morten Brekkevold's avatar Morten Brekkevold

add trailing slashes to endpoints

if POSTing or PATCHing using requests, and the web server directs to a
canonical url (with a trailing slash), it looks like requests does not transmit
the payload a second time :P
parent e952c066
......@@ -58,7 +58,7 @@ class NAVAPI(object):
def get_netbox(self, netbox_id):
try:
response = self._simple_get('/netbox/{}'.format(netbox_id))
response = self._simple_get('/netbox/{}/'.format(netbox_id))
except HTTPError as error:
if error.response.status_code == 404:
raise ObjectNotFound(error.response.content.decode())
......@@ -82,12 +82,12 @@ class NAVAPI(object):
return response
def delete_netbox(self, netbox_id):
response = self._simple_delete("/netbox/{}".format(netbox_id))
response = self._simple_delete("/netbox/{}/".format(netbox_id))
return response
def get_room(self, room_id):
try:
response = self._simple_get('/room/{}'.format(room_id))
response = self._simple_get('/room/{}/'.format(room_id))
except HTTPError as error:
if error.response.status_code == 404:
raise ObjectNotFound(error.response.content.decode())
......
Markdown is supported
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