From 31a6cecef92233d1714063f52a89c8efc3bbb98e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 17 Jun 2023 22:43:58 +0200 Subject: [PATCH] Allow specifying content-type for posts instead of hardcoding. --- Common/Net/HTTPClient.cpp | 2 +- Common/Net/HTTPClient.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Common/Net/HTTPClient.cpp b/Common/Net/HTTPClient.cpp index 43b30f7602..e8d3b6c7f5 100644 --- a/Common/Net/HTTPClient.cpp +++ b/Common/Net/HTTPClient.cpp @@ -604,8 +604,8 @@ std::shared_ptr Downloader::StartDownloadWithCallback( std::shared_ptr Downloader::AsyncPostWithCallback( const std::string &url, const std::string &postData, + const std::string &postMime, std::function callback) { - std::string postMime = "application/x-www-form-urlencoded"; std::shared_ptr dl(new Download(RequestMethod::POST, url, postData, postMime, Path())); dl->SetCallback(callback); newDownloads_.push_back(dl); diff --git a/Common/Net/HTTPClient.h b/Common/Net/HTTPClient.h index f6b832b834..7a0a87f3c0 100644 --- a/Common/Net/HTTPClient.h +++ b/Common/Net/HTTPClient.h @@ -202,6 +202,7 @@ public: std::shared_ptr AsyncPostWithCallback( const std::string &url, const std::string &postData, + const std::string &postMime, // Use postMime = "application/x-www-form-urlencoded" for standard form-style posts, such as used by retroachievements. std::function callback); // Drops finished downloads from the list.