mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-30 01:25:51 +00:00
Merge pull request #2402 from CookiePLMonster/fix-post
Fix POST messages
This commit is contained in:
commit
ddda82be2d
|
@ -56,10 +56,9 @@ bool HTTPDownloaderUWP::StartRequest(HTTPDownloader::Request* request)
|
||||||
|
|
||||||
if (req->type == Request::Type::Post)
|
if (req->type == Request::Type::Post)
|
||||||
{
|
{
|
||||||
const winrt::Windows::Storage::Streams::Buffer post_buf(static_cast<u32>(req->post_data.size()));
|
const HttpStringContent post_content(StringUtil::UTF8StringToWideString(req->post_data),
|
||||||
std::memcpy(post_buf.data(), req->post_data.data(), req->post_data.size());
|
winrt::Windows::Storage::Streams::UnicodeEncoding::Utf8,
|
||||||
|
L"application/x-www-form-urlencoded");
|
||||||
const HttpBufferContent post_content(post_buf);
|
|
||||||
req->request_async = req->client.PostAsync(uri, post_content);
|
req->request_async = req->client.PostAsync(uri, post_content);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -255,9 +255,10 @@ bool HTTPDownloaderWinHttp::StartRequest(HTTPDownloader::Request* request)
|
||||||
BOOL result;
|
BOOL result;
|
||||||
if (req->type == HTTPDownloader::Request::Type::Post)
|
if (req->type == HTTPDownloader::Request::Type::Post)
|
||||||
{
|
{
|
||||||
result = WinHttpSendRequest(req->hRequest, WINHTTP_NO_ADDITIONAL_HEADERS, 0, req->post_data.data(),
|
const std::wstring_view additionalHeaders(L"Content-Type: application/x-www-form-urlencoded\r\n");
|
||||||
static_cast<DWORD>(req->post_data.size()), static_cast<DWORD>(req->post_data.size()),
|
result = WinHttpSendRequest(req->hRequest, additionalHeaders.data(), additionalHeaders.size(),
|
||||||
reinterpret_cast<DWORD_PTR>(req));
|
req->post_data.data(), static_cast<DWORD>(req->post_data.size()),
|
||||||
|
static_cast<DWORD>(req->post_data.size()), reinterpret_cast<DWORD_PTR>(req));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue