[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:
Mike Fährmann
2022-03-23 21:48:38 +01:00
parent 9313d4dc10
commit c0c1277c5f

View File

@@ -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