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
4
votes
2 answers

VBA - Go to website and download file from save prompt

I've been spending the last few hours trying to figure out how to save a file onto the computer using VBA. The code template below that I found on another forum seems promising, except when I go to the desktop to access it, the .csv file has what…
user2370064
  • 41
  • 2
  • 2
  • 6
4
votes
0 answers

Why lpOptional parameter of WinHttpSendRequest is not const?

Is there any reason at all why lpOptional parameter of WinHttpSendRequest function is not const? Is it safe to assume that the data pointed to by lpOptional parameter will not be modified by WinHttpSendRequest function (and pass a pointer to…
PowerGamer
  • 2,106
  • 2
  • 17
  • 33
4
votes
1 answer

WinHttp: How to use a temporary certificate store?

I have a C++ application that makes a HTTPS connection to one of our servers. In my ideal world, I would like the following to occur: App Starts App makes Windows trust the server's root CA (no GUI please, just system calls) App talks to server,…
j w
3
votes
2 answers

Credential Provider communicating over network

First let me explain my desired solution: I'm making a custom Credential Provider to authenticate a user by sending logon credentials to an external authentication server, then passing the same credentials along with some extra authentication…
trbox
  • 476
  • 6
  • 16
3
votes
0 answers

SSL with WinHTTP

I have created a simple web server with winhttp that has only one client, a website. It worked perfectly until I enabled SSL. I don't get any errors, and everything seems to work, but the website gets error code 104 when it tries to connect, and I…
Andrew
  • 39
  • 1
  • 2
3
votes
1 answer

Save a file downloaded via WinHTTP to disk, using Delphi XE

An answer to this question showed how easy it is to use WinHTTP via Type Library imports in delphi. I imported the type library for WinHTTP, and then tried to write a File Download helper function using that api. Here's how far I got: I can't seem…
Warren P
  • 65,725
  • 40
  • 181
  • 316
3
votes
1 answer

Does handles from WinHTTP Async, needs to be closed?

Do you need to close the handles from WinHttpOpen(), WinHttpConnect() and WinHttpOpenRequest(), after you use them with async mode WinHttpOpen(). I suppose they need to be, but how is that done because everything is asynchronously done, I've seen…
2198du19as
  • 33
  • 3
3
votes
0 answers

Is there a way to send a POST through WinHttpSendRequest(); with the unicode representation of characters ie: \u0420?

I need to send a UTF-8 string with Unicode characters in it to a web API from a c/c++ application, I am sending it with a Content-Type of application/json. For example I have a string that is "щь". Currently what sends is the ASCII representation…
Steven
  • 41
  • 3
3
votes
1 answer

MSXML2.ServerXMLHTTP clientcertificate

I'm using MSXML2.ServerXMLHTTP in JScript / VBA and want to set the client certificate path. In WinHTTP.WinHTTPRequest I could use the option '.setClientCertificate', but this seems absent in MSXML2.ServerXMLHTTP. Is there any argument I can use for…
JasperD
  • 152
  • 1
  • 3
  • 15
3
votes
0 answers

Using winhttp for client with non default SSL server name indication (sni)

I'm using winhttp in order to establish https connection on port 443 with my remote. However, the server running this service also contains more services on the same https port (443), so it uses SNI in order to resolve the requested…
Zohar81
  • 4,554
  • 5
  • 29
  • 82
3
votes
1 answer

How to set a context for an asynchronous WinHttpWebSocketSend call?

WinHttpSendRequest has a dwContext parameter so that I can read the context from WINHTTP_STATUS_CALLBACK function. This context makes it possible to tell which WinHttpSendRequest is for the current callback. Unfortunately and weirdly, though,…
HaeRim Lee
  • 53
  • 6
3
votes
1 answer

GetLastError returns 6 after call to WinHttpOpenRequest

Im not sure if this is lack of knowledge in msdn or not. i Have the following code: #include "stdafx.h" #include #include #include #include #include "myHTTP.h" int main(){ …
jimmy
  • 73
  • 1
  • 7
3
votes
1 answer

Winhttp - Prevent successful handshake if peer certificate is invalid

Edit: The thread : https://security.stackexchange.com/questions/179352/winhttp-prevent-successful-handshake-if-peer-certificate-is-invalid discusses and answers the concern. This can be closed for now Using windows platform-provided WinHTTP on a…
3
votes
2 answers

What API to use for adding HTTP client support in an existing MFC app?

I have recently been given a task to add the ability to interact with Web Map Services to an existing MFC application and I am in need of a client-side HTTP API. Based on my research, the leading candidates seem to be CAtlHttpClient and WinHTTP. …
17 of 26
  • 27,121
  • 13
  • 66
  • 85
3
votes
1 answer

WinHttpSendRequest and ERROR_WINHTTP_RESEND_REQUEST

Is it possible for GetLastError() to return ERROR_WINHTTP_RESEND_REQUEST after calling WinHttpSendRequest? Documentation for WinHttpSendRequest: ERROR_WINHTTP_RESEND_REQUEST The application must call WinHttpSendRequest again due to a redirect…
Ali Asadpoor
  • 327
  • 1
  • 13