@@ -73,14 +73,17 @@ def decode(self, raw_body):
73
73
else :
74
74
return json .loads (raw_body )
75
75
76
- def post (self , url , body = None ):
76
+ def delete (self , url , params = None ):
77
77
"""
78
- Executes an HTTP POST request for the given URL
78
+ Executes an HTTP DELETE request for the given URL
79
+
80
+ params should be a urllib.urlencoded string
79
81
"""
80
- response , content = self .http .request (url , method = "POST" ,
81
- body = body ,
82
- headers = self .headers )
82
+ if params :
83
+ url = '?' .join ([url , params ])
83
84
85
+ response , content = self .http .request (url , method = "DELETE" ,
86
+ headers = self .headers )
84
87
return self .process (response , content )
85
88
86
89
def get (self , url , params = None ):
@@ -96,6 +99,16 @@ def get(self, url, params=None):
96
99
headers = self .headers )
97
100
return self .process (response , content )
98
101
102
+ def post (self , url , body = None ):
103
+ """
104
+ Executes an HTTP POST request for the given URL
105
+ """
106
+ response , content = self .http .request (url , method = "POST" ,
107
+ body = body ,
108
+ headers = self .headers )
109
+
110
+ return self .process (response , content )
111
+
99
112
def process (self , http_response , content ):
100
113
"""
101
114
Returns HTTP backend agnostic Response data
0 commit comments