[downloader:http] support sending POST data (#2433)
by setting the '_http_data' metadata field for a file
needed in addition to be3492776b
to download files with POST requests
This commit is contained in:
@@ -121,8 +121,13 @@ class HttpDownloader(DownloaderBase):
|
|||||||
try:
|
try:
|
||||||
response = self.session.request(
|
response = self.session.request(
|
||||||
kwdict.get("_http_method", "GET"), url,
|
kwdict.get("_http_method", "GET"), url,
|
||||||
stream=True, headers=headers, timeout=self.timeout,
|
stream=True,
|
||||||
verify=self.verify, proxies=self.proxies)
|
headers=headers,
|
||||||
|
data=kwdict.get("_http_data"),
|
||||||
|
timeout=self.timeout,
|
||||||
|
proxies=self.proxies,
|
||||||
|
verify=self.verify,
|
||||||
|
)
|
||||||
except (ConnectionError, Timeout) as exc:
|
except (ConnectionError, Timeout) as exc:
|
||||||
msg = str(exc)
|
msg = str(exc)
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user