Questions tagged [winhttp]

Windows HTTP Services (WinHTTP) is an HTTP client application library provided by Microsoft as part of Windows to send the requests through the HTTP protocol to other HTTP servers.

See Windows HTTP Services page for the WinHTTP documentation.

See also this seminal MSDN article detailing the use of the library's asynchronous API in C++.

This tag should be used for questions relating specifically to the WinHTTP library.

417 questions
3
votes
2 answers

wininet or winhttp, which is preferred for POST requests

I was going through the MSDN page comparing WinInet and WinHttp. Seems as though WinInet has more functionality than WinHttp. The MSDN page is here. Under what circumstances would one choose WinHttp over WinInet? Considering that WinInet has…
David
  • 183
  • 1
  • 2
  • 14
3
votes
3 answers

How to make HTTPS calls (POST requests) using WinHTTP on C++?

I'm writing program on C++ to make calls (POST requests) to Java Servlets using WinHTTP. When I request POST via HTTP everything is OK, problem occurs when I request via HTTPS. It sends empty requests to the server but cuts off request body (but it…
Nurzhan Aitbayev
  • 797
  • 1
  • 10
  • 23
3
votes
2 answers

How to get WinInet's proxy settings quickly (without network dependency)

How can I quickly retrieve Internet Explorer's proxy settings from C++? The windows function WinHTTPGetIEProxyConfigForCurrentUser() gives me exactly what I want. The problem with WinHTTPGetIEProxyConfigForCurrentUser() is it is running unacceptably…
Eric
  • 31
  • 1
  • 3
3
votes
1 answer

WebSocket client in C and win32 for Windows 7

I'm trying to figure out a way to implement a sample WebSocketClient in C using win32 APIs. I need it to communicate with a HTML+JS WebSocket server. I see that most of the WebSocket specific APIs are supported only Windows 8 and above. Like in…
DebugBreak
  • 201
  • 3
  • 8
3
votes
0 answers

WinHttp responds with ERROR_WINHTTP_INVALID_SERVER_RESPONSE on WinXP despite receiving 200/OK response

I am trying to debug an issue, but could use some pointers from others suffering similar fate. The issue seems to be with Windows XP SP3 and use of the WinHttp library with certificates installed. Under these conditions, WinHttp throws a…
Craig
  • 4,268
  • 4
  • 36
  • 53
3
votes
1 answer

WinHTTP VBA subsequent request cannot use the previous login credentials?

I'm using WinHTTP in Access 2007 VBA to fetch some list of items requiring a cookie login credential account. First I login through https://www.example.com/login.php with this: Dim strCookie As String, strResponse As String, _ strUrl As…
jacouh
  • 8,473
  • 5
  • 32
  • 43
3
votes
0 answers

Get WinHTTP to use the credentials from WinInet

I'm writing a service, hence using WinHTTP instead of WinInet. While reading MSDN it talks about setting WINHTTP_OPTION_USE_GLOBAL_SERVER_CREDENTIALS (http://msdn.microsoft.com/en-us/library/windows/desktop/aa384066(v=vs.85).aspx) to have WinHTTP…
3
votes
1 answer

SQL Server Periodic Fixed Delays

We are connecting to an SQL Server 2008 on another box using PHP 5.3 and pdo_dblib. Periodically (10+ times a day randomly throughout the day) we experience 3 minute periods where all SQL Select queries will take 21.01 seconds to run, regardless of…
kevinnuut
  • 116
  • 4
3
votes
0 answers

SugarSync API get user's info: Error 401 unauthorized

I'm trying to get a request for the user's information using WinHttp functions. The REST API call for SugarSync is referenced here. My code is as follows: DWORD dwBytesWritten = 0; DWORD dwStatusCode = 0; DWORD dwSize = sizeof(DWORD); BOOL …
3
votes
1 answer

Retrieve HTTP response even if malformed from WinHTTP

With WinHTTP, WinHttpReceiveResponse will return ERROR_WINHTTP_INVALID_SERVER_RESPONSE if there is something wrong with an HTTP header for example. Is there anyway to get to the data that was returned, despite the fact that it was malformed?
DougN
  • 4,407
  • 11
  • 56
  • 81
3
votes
1 answer

WinHttpOpen leaking memory

I've been trying to debug a memory leak in my program, and have narrowed it down to the WinHttp comms. I've been able to reproduce the problem in the following test code: #include #include "winhttp.h" void main() { while (1) { …
seanneko
  • 33
  • 3
3
votes
1 answer

How to ignore invalid certificates with IWinHttpRequest?

i am using Microsoft's WinHttpRequest COM object to request a web-page with an invalid certificate: IWinHttpRequest http = new WinHttpRequest(); http.Open("GET", url, false); http.Send(null); Except that the call to Send throws an…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
3
votes
2 answers

WinHttp used in async mode - ERROR_INTERNET_CANNOT_CONNECT how to cleanly close connection

I get lots of ERROR_INTERNET_CANNOT_CONNECT (12029 code) in callback procedure of the request. I use WinHttp in async mode(on a server). How do you cleanly close the connection in this case. Do you just use something like this(like you normally…
Ghita
  • 4,465
  • 4
  • 42
  • 69
3
votes
1 answer

What is phrase "URL reservation in HTTP.SYS" means?

Can't understand the meaning of this phrase. People on forums suggests each other to reserve url in HTTP.sys, but what does it mean? What is it for? How does it works? All it comes from HttpWebRequest uac problems.
er-v
  • 4,405
  • 3
  • 30
  • 37
3
votes
3 answers

What's the correct way to use win32inet.WinHttpGetProxyForUrl

I'm trying to use a feature of the Microsoft WinHttp library that has been exposed by the developers of Win32com. Unfortunately most of the library does not seem to be documented and there are no example of the correct way to use the win32inet…
Salim Fadhley
  • 22,020
  • 23
  • 75
  • 102