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

Commit05e85a2

Browse files
committed
add PUT support to HTTPBackend
now correctly sets the content-length header`resubmit` and `cancel` use these methods
1 parentd57c7f6 commit05e85a2

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

‎zencoder/core.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,19 +127,20 @@ def post(self, url, body=None):
127127

128128
returnself.process(response,content)
129129

130-
defput(self,url,body=None):
130+
defput(self,url,data=None,body=None):
131131
"""
132132
Executes an HTTP PUT request for the given URL
133133
"""
134-
_headers=self.headers.copy()
135-
ifbody:
136-
content_length=str(len(body))
137-
else:
138-
content_length=0
139-
_headers['Content-Length']=str(content_length)
134+
headers=self.headers
135+
headers['Content-Length']=self.content_length(body)
136+
137+
ifdata:
138+
params=urlencode(data)
139+
url='?'.join([url,params])
140+
140141
response,content=self.http.request(url,method="PUT",
141142
body=body,
142-
headers=_headers)
143+
headers=headers)
143144

144145
returnself.process(response,content)
145146

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp