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
1
vote
1 answer

Send User-Agent through CONNECT and POST with WinHTTP?

I'm trying to POST to a secure site using WinHttp, and running into a problem where the User-Agent header isn't being sent along with the CONNECT. I am using a lightly-modified code sample from MSDN: HINTERNET hHttpSession = NULL; HINTERNET…
Duncan Bayne
  • 3,870
  • 4
  • 39
  • 64
1
vote
0 answers

WinHttp verify peer and server and ssl callback

I need some alternative to following libcurl functions in WinHttp. curl_easy_setopt(cURLHandle, CURLOPT_SSL_VERIFYPEER, vP); curl_easy_setopt(cURLHandle, CURLOPT_SSL_VERIFYHOST, vH); and curl_easy_setopt(cURLHandle, CURLOPT_SSL_CTX_FUNCTION,…
kushpf
  • 1,078
  • 10
  • 22
1
vote
0 answers

Winhttp request give error Error 87 has occurred. Could not close the hSession handle for post json request

hi i am implementing post json request with winhttp function. though no error in code but at time of execution i cant get proper output for it. it gives me error for it like Error 87 has occurred. Could not close the hSession handle. it means open…
user3505712
  • 895
  • 1
  • 11
  • 20
1
vote
1 answer

C++ WinHttp get response header and body

I'm currently trying to write a class to make sending simple requests easier for me. In the end I'd like it to be usable somewhat like this: int _tmain(int argc, _TCHAR* argv[]) { HttpRequest Request(L"Example UserAgent/1.0",L"",L""); …
Forivin
  • 14,780
  • 27
  • 106
  • 199
1
vote
0 answers

VBA WinHttp component

Here is an issue regarding VBA. I've scoured my books and searched the web for the answer on this piece of code Set WinHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1") so I've tried countless times to search Google with: WinHttp Object VBA and…
ExoticBirdsMerchant
  • 1,466
  • 8
  • 28
  • 53
1
vote
1 answer

Upload TXT or CSV file Using WinHTTP and LotusScript

'Declare long Dim lng_resolveTimeout, lng_connectTimeout, lng_sendTimeout, lng_receiveTimeout As Long 'Declare integer Dim int_serverCredentials As Integer 'Declare variants Dim var_submitObject As Variant 'Set values int_serverCredentials =…
Heubel
  • 11
  • 3
1
vote
1 answer

Why does declaring content as a string cause WinHttp to not send HTTP content in Excel VBA?

I have an Excel VBA macro which does the equivalent of the following HTTP POST which works successfully: Set WebClient = CreateObject("WinHttp.WinHttpRequest.5.1") ' ... Configure WebClient for a POST request RequestBody = "" WebClient.send…
Matthew Murdoch
  • 30,874
  • 30
  • 96
  • 127
1
vote
0 answers

Is it possible to use "Transfer-Encoding: Chunked" header with windows authentication?

WinHTTP authentication described here: http://msdn.microsoft.com/en-us/library/windows/desktop/aa383144(v=vs.85).aspx works if I don't use "Transfer-Encoding: Chunked\r\n" header when calling WinHttpSendRequest(). If I do, I'm not able to log on,…
user1090249
1
vote
0 answers

WinHttp Async Callback in vb6

I have a vb6 service which uses Synchronous WinHttp calls to a remote server. These calls lockup the service during times when there appears to be connection issues (network/Internet etc). My task is to implement WinHttp Asynchronous calls. First…
Ben
  • 1,000
  • 2
  • 15
  • 36
1
vote
0 answers

Windows Server 2008 ServerXMLHTTP Proxy

Migrated an applicatoin from Window Server 2003 to Window Server 2008 x64. We have a simple VBS script that goes outside the domain and grabs a XML document using a post request. The script works perfect on Windows Server 2003, however on the new…
Brad
  • 1,684
  • 4
  • 20
  • 36
1
vote
2 answers

VBA Web Scraping from www.eppraisal.com

I need to fetch data from www.eppraisal.com So I have written following code but it's not working unfortunately: Public Function GetEppraisalValuation() Dim strURL As String Dim strLocationURL As String Dim strEppraisalValue As String …
TechGeek
  • 2,172
  • 15
  • 42
  • 69
1
vote
2 answers

Sending pre-encrypted data through SSL

A client need to be authenticated by the server, so it need to send credentials. The credentials can be stored in a client database as in encrypted form. Since the server's certificate is known, in order to provide best security the client can use…
Earth Engine
  • 10,048
  • 5
  • 48
  • 78
1
vote
1 answer

what is the best library to send http request for desktop applications

My application is running in Windows and I have to send some requests to the server. I am currently using libcurl. However there is a limitation when proxy server with authentication is involved before the request sent out to the server. I explored…
linux developer
  • 821
  • 1
  • 13
  • 34
1
vote
0 answers

Map errors returned from WinHttpSendRequest using FormatMessage

When invoking WinHttpSendRequest, I get an error value using GetLastError (e.g ERROR_WINHTTP_CANNOT_CONNECT). But when trying to map the error code to a user friendly error message using FormatMessage, no mapping is found. Is there a way to…
mox
  • 6,084
  • 2
  • 23
  • 35
1
vote
1 answer

Access violation in winhttp.dll

I'm trying to perform an HTTP GET using WinHTTP in C++, but it's crashing at some point after resolving the name (after getting the WINHTTP_CALLBACK_STATUS_NAME_RESOLVED in the status callback function). I'm getting an access violation in…
Andrew Porritt
  • 1,716
  • 15
  • 24