Ejemplo n.º 1
0
    def delete(self, name):

        logger.debug(u'deleting {0}'.format(name))

        for location in self._locations:
            logger.debug(u'deleting in {0}'.format(location))
            response = requests.delete(
                self._get_full_path(location, name), timeout=self._timeout)
            if response.status_code not in (204,):
                msg = u"deleting {0}: status code {1}".format(
                    self._get_full_path(location, name), response.status_code)
                logger.error(msg)
                raise WebDAVException(msg)

        logger.debug(u'{0} deleted'.format(name))
Ejemplo n.º 2
0
 def test_HTTP_DELETE(self):
     r = requests.delete(build_url("delete"))
     self.assertEquals(r.status_code, 200)
Ejemplo n.º 3
0
def delete(uri, token=None):
    headers = {"X-Auth-Token": token, "content-type": "application/json"}
    return requests.delete(uri, headers=headers)
Ejemplo n.º 4
0
def delete(uri):
    headers = {"X-Auth-Token": account_data["token"], "content-type": "application/json"}
    return requests.delete(uri, headers=headers)