Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e6833df

Browse filesBrowse files
committed
add HTTP DELETE method
1 parent 1f16c8d commit e6833df
Copy full SHA for e6833df

File tree

1 file changed

+18
-5
lines changed
Filter options

1 file changed

+18
-5
lines changed

‎zencoder/core.py

Copy file name to clipboardExpand all lines: zencoder/core.py
+18-5Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,17 @@ def decode(self, raw_body):
7373
else:
7474
return json.loads(raw_body)
7575

76-
def post(self, url, body=None):
76+
def delete(self, url, params=None):
7777
"""
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
7981
"""
80-
response, content = self.http.request(url, method="POST",
81-
body=body,
82-
headers=self.headers)
82+
if params:
83+
url = '?'.join([url, params])
8384

85+
response, content = self.http.request(url, method="DELETE",
86+
headers=self.headers)
8487
return self.process(response, content)
8588

8689
def get(self, url, params=None):
@@ -96,6 +99,16 @@ def get(self, url, params=None):
9699
headers=self.headers)
97100
return self.process(response, content)
98101

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+
99112
def process(self, http_response, content):
100113
"""
101114
Returns HTTP backend agnostic Response data

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.