Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commite6833df

Browse files
committed
add HTTP DELETE method
1 parent1f16c8d commite6833df

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

‎zencoder/core.py

Lines 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
returnjson.loads(raw_body)
7575

76-
defpost(self,url,body=None):
76+
defdelete(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+
ifparams:
83+
url='?'.join([url,params])
8384

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

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

102+
defpost(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+
returnself.process(response,content)
111+
99112
defprocess(self,http_response,content):
100113
"""
101114
Returns HTTP backend agnostic Response data

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp