I am using HttpOpenRequest to send data of the form /path?data=xyzzy. However xyzzy can be very large, 100s of k at times, and on certain machines HttpOpenRequest fails with error 122 (ERROR_INSUFFICIENT_BUFFER)

According to Microsoft kb 208427 the Maximum URL length is 2,083 characters in Internet Explorer

but it also states

'However, the POST method is not limited by the size of the URL for submitting name/value pairs. These pairs are transferred in the header and not in the URL'

An answer to my question, Why might HttpOpenRequest fail with error 122, and several other sources, suggest that the data should be sent by HttpSendRequest, but this does not send the data as part of the headers, and is not being picked up as a name/value pair.

How can I send large amounts of data over http using name/value pairs?

My code is

std::string fURL = "/path"; std::string payload = "xml=xmldata"; HINTERNET fSessionHandle = InternetOpenW(L"Agent", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0); HINTERNET fConnectHandle = InternetConnectW(fSessionHandle, L"172.24.5.42", 8090, NULL, NULL, INTERNET_SERVICE_HTTP, WININET_API_FLAG_SYNC, 0); HINTERNET fRequestHandle; LPCSTR types[] = { "application/x-www-form-urlencoded", NULL }; fRequestHandle = HttpOpenRequestA(fConnectHandle, "POST", fURL.c_str(), NULL, NULL, types , INTERNET_FLAG_RELOAD|INTERNET_FLAG_NO_CACHE_WRITE, 0); if (fRequestHandle) { if (!HttpSendRequestW(fRequestHandle, NULL, -1, (LPVOID)payload.c_str(), (DWORD)payload.length())) std::cerr << "HTTP Send Request failed, sys error " << GetLastError(); } else std::cerr << "HTTP Open Request failed, sys error " << GetLastError();


Related news

Medidas de tendencia central moda para datos agrupados
Accommodation poppies 1 kuta bali weather
Para que sirve la rom en un celular
Assentamentos humanos que surgiram as margens do rio huang-ho
Norfolk broads wroxham accommodation
Pensaste que no podia vivir sin ti estela
La verdad incomoda reflexion
Histoire des arts l'art baroque