def delete(port, url, au): http = HttpSession(base + ":" + port) data = http.delete(url, headers={ 'Authorization': au, 'Content-Type': 'application/json', 'accept': 'application/json' }) return data
def delete(port, url, au): # data = requests.delete(url, data=data, headers={'Authorization': au, 'Content-Type': 'application/json', # 'accept': 'application/msgpack'}) http = HttpSession(base + ":" + port) data = http.delete(url, headers={ 'Authorization': au, 'Content-Type': 'application/json', 'accept': 'application/msgpack' }) if data.status_code == 400: return Http_esponseDecode(data) else: return data
def test_delete(self): s = HttpSession("http://127.0.0.1:%i" % self.port) r = s.delete("/request_method") self.assertEqual(200, r.status_code) self.assertEqual("DELETE", r.content.decode())