Пример #1
0
    def delete(self, uri):
        """DELETE request to server.

        Args:
            uri: Server URI to access (without base URL).
        Raises:
            InteropError: Error from server.
            requests.Timeout: Request timeout.
        """
        r = self.session.delete(self.url + uri, timeout=self.timeout)
        if not r.ok:
            raise InteropError(r)
        return r
Пример #2
0
    def put(self, uri, **kwargs):
        """PUT request to server.

        Args:
            uri: Server URI to access (without base URL).
            **kwargs: Arguments to requests.Session.put method.
        Raises:
            InteropError: Error from server.
            requests.Timeout: Request timeout.
        """
        r = self.session.put(self.url + uri, timeout=self.timeout, **kwargs)
        if not r.ok:
            raise InteropError(r)
        return r