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

How to get request cookies with winhttp?

Response cookies ('Set-Cookie' response header) obtained fine, but request cookies ('Cookie' request header) I can't obtain by WinHttpQueryHeaders even with WINHTTP_QUERY_FLAG_REQUEST_HEADERS: DWORD size = 0; BOOL re = WinHttpQueryHeaders(hRequest,…
emett
  • 128
  • 13
2
votes
0 answers

WinHttpConnect does not return error on bad URL

I have been using WinHTTP API functions from PowerBuilder 10 and it works really well except that the WinHttpConnect function does not return an error when the URL is bad. If I pass an empty string for ServerName then the returned handle is zero but…
Roland Smith
  • 957
  • 4
  • 7
2
votes
0 answers

VBA WinHTTP Auto detect proxy settings

I am trying to send request to a web service from behind a proxy server in excel vba. How can i make my code auto detect proxy settings? Url = "www.example.com" Set WHTTP = CreateObject("WinHTTP.WinHTTPrequest.5.1") WHTTP.Open "GET", Url,…
Amelie Peter
  • 93
  • 3
  • 14
2
votes
1 answer

Async callback call for a sync WinHTTP request

I'm using WinHTTP in sync mode, without passing the WINHTTP_FLAG_ASYNC flag, and I thought that the callback is always being called synchronously. That is indeed what's happening most of the time, but sometimes, when calling WinHttpCloseHandle, the…
Paul
  • 6,061
  • 6
  • 39
  • 70
2
votes
0 answers

Progress bar for download with VBA and WinHttpRequest

I have an Access 2010 database using the WinHttp.WinHttpRequest.5.1 object to login into a server and then download Excel files that then get imported. The download of the files is painfully slow, so desperately need a progress bar or similar. But…
Matt B
  • 21
  • 1
2
votes
1 answer

Upload file via HTTP from VBA (WinHTTP)

I'm trying to (HTTP) upload a binary file programmatically from within VBA. I intend to put an ASPX page on the server to accept the file and certain additional parameters. I know there are lots of nice ways to do that (e.g. use web service instead…
chiccodoro
  • 14,407
  • 19
  • 87
  • 130
2
votes
1 answer

Win32: What is the status of chunked encoding support in WinHttpReadData?

The documentation for WinHttpReadData says, regarding HTTP's chunked transfer coding: Starting in Windows Vista and Windows Server 2008, WinHttp enables applications to perform chunked transfer encoding on data sent to the server. When the…
Cheeso
  • 189,189
  • 101
  • 473
  • 713
2
votes
1 answer

VBA WinHTTP to login into Oddsportal

I am trying to login into oddsportal through a VBA script. I have written the following code but it is not working. I am getting an error when I am truing to set cookie for POST request. I would be thankful if someone could point me in the right…
2
votes
0 answers

WinHttpReceiveResponse() always returns ERROR_INTERNET_INCORRECT_HANDLE_STATE

I'm trying to add WinHTTP authentication to my application. The application should connect to the IIS and stream some data. After sending some chunked data with the WinHttpWriteData() API (Transfer-Encoding: Chunked), I can see in network monitor…
user1090249
2
votes
1 answer

msdn upload image with winhttp c++

I have been trying this the whole day but no luck i want to upload an image file to a php file which i have created but when ever i try to do that winhttpsendrequest throws 183 error that means cannot send file that is already sent please can…
Keshav Nair
  • 423
  • 1
  • 14
  • 24
2
votes
0 answers

WinHttpSendRequest in async mode doesn't send POST data

I'm having an issue sending POST data via WinHttpSendRequest in asynchronous mode. In synchronous mode: WinHttpAddRequestHeaders(request_handles.at(handler_index), L"Content-Type:application/x-www-form-urlencoded", -1L, WINHTTP_ADDREQ_FLAG_ADD); int…
user462879
  • 187
  • 1
  • 13
2
votes
2 answers

compile errors w/wininet & winhttp in MFC application

Strangely I had this working before but I reinstalled my system, upgraded to w7 and now I can't seem to get this code to compile. The problem is that I'm using winhttp.h in most of my application, but I have a simple FTP client object that I wrote…
amirpc
  • 1,638
  • 3
  • 19
  • 24
2
votes
1 answer

Do I really need to register WinHttp on Windows Server 2008 before using WinHttpRequest.5.1?

Basically I think this is a bug in Windows Server 2008, but I am not a COM ninja so it seems equally likely that I'm just doing something dumb. The question is: bug or programmer error? We use WinHttpRequest (the ActiveX component of WinHttp) to…
Robert Calhoun
  • 4,823
  • 1
  • 38
  • 34
2
votes
1 answer

Purpose of WINHTTP_QUERY_URI in WinHTTP?

What HTTP header exactly can be queried using WINHTTP_QUERY_URI flag with WinHttpQueryHeaders function? After reading its description I was under impression this flag was supposed to be used to get the URI of the request specified in…
PowerGamer
  • 2,106
  • 2
  • 17
  • 33
2
votes
1 answer

What's the difference between resolving WPAD in process and out of process?

In the WinHTTP autoproxy API, the WINHTTP_AUTOPROXY_OPTIONS will accept flags for WINHTTP_AUTOPROXY_RUN_INPROCESS and WINHTTP_AUTOPROXY_RUN_OUTPROCESS_ONLY. What's the difference between these two flags and when would you use them?
0x1mason
  • 757
  • 8
  • 20