diff --git a/rsd_lib/base.py b/rsd_lib/base.py index dd82230..8f84e52 100644 --- a/rsd_lib/base.py +++ b/rsd_lib/base.py @@ -120,6 +120,18 @@ class ResourceBase(base.ResourceBase): description = base.Field("Description") """The resource description""" + def post(self, data): + """Issue HTTP POST request to this resource""" + self._conn.post(self.path, data=data) + + def patch(self, data): + """Issue HTTP PATCH request to this resource""" + self._conn.patch(self.path, data=data) + + def put(self, data): + """Issue HTTP PUT request to this resource""" + self._conn.put(self.path, data=data) + def delete(self): """Delete this resource""" self._conn.delete(self._path) @@ -133,6 +145,18 @@ class ResourceCollectionBase(base.ResourceCollectionBase): description = base.Field("Description") """The resource collection description""" + def post(self, data): + """Issue HTTP POST request to this resource""" + self._conn.post(self.path, data=data) + + def patch(self, data): + """Issue HTTP PATCH request to this resource""" + self._conn.patch(self.path, data=data) + + def put(self, data): + """Issue HTTP PUT request to this resource""" + self._conn.put(self.path, data=data) + def delete(self): """Delete this resource collection""" self._conn.delete(self._path)