winhttp

How do I prevent ServerXMLHTTP from automatically following redirects (HTTP 303 See Other responses)?

I am using ServerXMLHTTP to perform an HTTP POST. The response returned is a redirect (specifically 303 See Other). ServerXMLHTTP is automatically following this redirect but this is causing an authentication failure as is not propagating the Authorization header of the original request. Is there a way I can prevent the automatic redire...

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 = "<request>" WebClient.send RequestBody Previously, I had explicitly set the type of RequestBody as a String as in...

WinHttp Gets 404 File Not Found

I am grabbing a webpage with WinHttp and the resulting page is the site's 404 file not found page. I know that the code works as I have tested it with other websites. The page in question is a normal http protocol and .html file. What can I do? ...

WinHttp.WinHttpRequest in .NET

Is there a built-in .NET class that can replace or work like WinHttp.WinHttpRequest? Thanks! ...

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. I was curious to see if anyone had experiences they could share or opinions on which woul...

What's the recommended way to get winhttp.h?

Our application uses libcurl for HTTP, and we want to get access to Internet Explorer's proxy settings. An earlier Stack Overflow question recommends that we use WinHttpGetIEProxyConfigForCurrentUser and WinHttpGetProxyForUrl. Unfortunately, the winhttp.h header does not appear to be included with our copies either Visual C++ 2005 or Vi...

How to download a file with WinHTTP in C/C++ ?

I know how to download an html/txt page. For example : //Variables DWORD dwSize = 0; DWORD dwDownloaded = 0; LPSTR pszOutBuffer; vector <string> vFileContent; BOOL bResults = FALSE; HINTERNET hSession = NULL, hConnect = NULL, hRequest = NULL; // Use WinHttpOpen to obtain a session handle. hSession = WinHttpOp...

VBA and WinHttp: how to submit to a page that may redirect to a login page

I am using a macro in outlook VBA to submit a file via POST to a URL: Set http = New WinHttp.WinHttpRequest http.Open "POST", UrlToPostTo, False 'True ' http.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" http.setRequestHeader "Content-Type", "multipart/for...

How can I get response information from IE programatically?

I want to know what are different ways to get the response code information when we visit any page in IE by using Windows API or some interfaces using C++? I think some ways include 1)Using BHO: But I think that will give HTML information.Can we get information related to HTTP here like response codes? 2)Using Async Pluggable Prot...

Why doesn't WinHTTP work while debugging?

I am using WinHTTP (WinAPI interface) in a C program. When I'm running the relase build from outside the ide (that is, without any debugger. IDE is VS2008) it works fine. However, if I run it inside the debugger (either the release or the debug build), or if I run the debug build from outside, WinHTTP won't work right. The status callb...

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 features via the win32com library. This is what I have so far: import win32inet hinternet = w...

In the windows API, is there a generic method which will give you the appropriate HTTP proxy for a URL?

I'm writing an application intended for distribution around the world. I recently discovered a method of WinHTTP: http://msdn.microsoft.com/en-us/library/aa384097(VS.85).aspx This can decode any Netscape-style PAC file (in Javascript) and tell me the correct proxy to use for any URL I might want to use. That's all great, but I've not...

differences between Msxml2.ServerXMLHTTP and WinHttp.WinHttpRequest?

just when I finally understood the difference between Msxml2.XMLHTTP and Msxml2.ServerXMLHTTP http://support.microsoft.com/kb/290761 XMLHTTP is designed for client applications and relies on URLMon, which is built upon Microsoft Win32 Internet (WinInet). ServerXMLHTTP is designed for server applications and relies on a new HTTP clie...

How to retrieve cookies for a specific site and path in winhttp

I would like to retrieve the cookies stored in the winhttp session cache based upon a specific host and path that I am about to send a request to. I want to retrieve those cookies before I send the request, so I don't have the request handle yet, all I have is the session and connection handles and of course the path and host I'm going t...

Mantis BT export request via "WinHttp.WinHttpRequest.5.1"

Hello, My boss asked me to export the corp's Mantis bugs database to Excel, but he can't give me access to the SQL Server, and the process has to be automated. The ONLY thing I can use is Excel (no ODBC, no manual export). So I managed to do this : Dim webClient As Object Dim i As Long, vFF As Long, oResp() As Byte Dim vLocalFile As...

WinHTTP Connect

I am trying to have WinHttp make a “CONNECT” calls (as opposed to a “GET” or “POST”) that looks as follows: CONNECT www.etrade.com:443 HTTP/1.0 Host: www.etrade.com However, winhttp always enforces a path after the “CONNECT” verb as follows (at the front of the location): CONNECT /www.etrade.com:443 HTTP/1.0 Host: www.etrade.com A...

Progress indication with HTTP file download using WinHTTP

Hi, I want to implement an progress bar in my C++ windows application when downloading a file using WinHTTP. Any idea how to do this? It looks as though the WinHttpSetStatusCallback is what I want to use, but I don't see what notification to look for... or how to get the "percent downloaded"... Help! Thanks! ...

Specify which Network Card/Connection Winhttp Must Use

I have an application in C# that utilizes Winhttp to make web requests. Is there a way to specify which network card WinHTTP must utilize for its connections? ...

WinHTTP IWinHttpRequest iface - cookie handling - how to get cookies from response?

Hello I'm using WinHTTP IWinHttpRequest object. I do POST to a https domain specyfying a request body with credentials. The site is expected to return cookies in HTTP response. The code works in Wininet - but I don't know how in WinHTTP to get cookies from the HTTP response? Can anybody help? Dominik ...

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, does its work, etc. App makes windows forget about the server's root CA done I do NOT wan...