[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:
|
||||
response = self.session.request(
|
||||
kwdict.get("_http_method", "GET"), url,
|
||||
stream=True, headers=headers, timeout=self.timeout,
|
||||
verify=self.verify, proxies=self.proxies)
|
||||
stream=True,
|
||||
headers=headers,
|
||||
data=kwdict.get("_http_data"),
|
||||
timeout=self.timeout,
|
||||
proxies=self.proxies,
|
||||
verify=self.verify,
|
||||
)
|
||||
except (ConnectionError, Timeout) as exc:
|
||||
msg = str(exc)
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user