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
0
votes
1 answer

InternetExplorer | IE.au3 get all the cookies of a session

I tried to create a automated login for a page. I wanted to login with InternetExplorer and give the session to a WinHTTP-Request to work with it. To do that I need all the cookies but I only get a few. Here is an example: The cookies chrome shows…
Trojan
  • 485
  • 4
  • 20
0
votes
1 answer

How to reset WinHTTP proxy credentials after a failed request?

I need to write code to download a file and the requirements are as follows. If the application is configured to use a proxy, attempt to download via the proxy. If that fails, attempt a direct connection. If no proxy is configured, attempt a…
Luke
  • 11,211
  • 2
  • 27
  • 38
0
votes
1 answer

WinHttpConnect fails, GetLastError returns 6

Any guesses as to why this simple test code would show WinHttpConnect fails with error code 6 (invalid handle or ERROR_INVALID_HANDLE): HINTERNET internet =…
eselk
  • 6,764
  • 7
  • 60
  • 93
0
votes
0 answers

winhttp client and openssl server communication error

I have encounted a strange communication problem when using winhttp to program http client and using openssl to program http server. I use wireshark to analyze the communication. Everything seems ok when handshake between the two, and the handshake…
mortimer
  • 1
  • 2
0
votes
1 answer

WinHttpReceiveResponse function return an error

Can someone tell me what is wrong in the code below? void Mess(LPCWSTR Str) { MessageBox(0, Str, L"Hi", 0); } int main() { // HttpOpen HINTERNET hHttp = NULL; LPCWSTR lpcwAgent = L"UserAgent"; DWORD dwAccessType =…
dnvThai
  • 123
  • 8
0
votes
2 answers

Getting redirect information with C# and C++

What am I doing wrong? I'm trying to get redirect information from a server that I use for authenticating a user. This works good with my C# code but I cannot make my C++ code working. So here's the working C# code: string postData =…
Simon Linder
  • 3,378
  • 4
  • 32
  • 49
0
votes
0 answers

WinhttpOpenRequest returns error 998

When I use the winhttp client application consecutive times, the WinHttpOpenRequest returns error 998. bResults = WinHttpOpenRequest( hFileHttp.hConnect, L"POST", urlCompo.lpszUrlPath, …
kapuya
  • 1
0
votes
0 answers

C++ WinHTTP, can't get this to work

I want to use WinHTTP to do some HTTP requests. Really basic stuff, but WinHTTP seems to be kind of complex compared to what I actually just want to do. Well, I couldn't even get this example code from the msdn to…
Forivin
  • 14,780
  • 27
  • 106
  • 199
0
votes
1 answer

Vba download file from internet WinHttpReq with login not working

I have been looking for a solution to automatize the dowload of a csv table from a site, but I haven't found a working solution. If I get on IE or Chrome, after previous log in I enter the url and the file automatically start dowloading. At this…
marko c.
  • 355
  • 1
  • 3
  • 16
0
votes
1 answer

IWinHttpRequest fails with status code 407 even after SetCredentials for "www.google.com"

My system Browser (IE) is proxy authenticated. I tried to download "www.google.com" using IWinHttpRequest it fails with status code 407 ( Need Proxy Authentication ) even after setting the user name and password using SetCredentials(...) for…
0
votes
4 answers

Covert String to LPVOID and LPCWSTR in C++

I’m working with the winHTTP API in c++ and I have started to write a wrapper class for my application. For simplicity I have a number of functions that can take string parameters and use them in the winHTTP calls. However many of these require the…
Andy
  • 13
  • 1
  • 4
0
votes
3 answers

Dynamically allocate memory for storage of HTML source downloaded with WinHttpReadData

First of all, string cannot be used, this is a requirement. I am attempting to implement Winhttp in order to download content from HTTP. I have used the example provided on MSDN…
user2541103
0
votes
1 answer

WinHTTP Request data in unicode?

I'm trying to read a web page via WinHTTP: bool WinHTTPClass::QueryResponseData(std::string &query_data) { // Read response DWORD dwSize, dwDownloaded = 0; do { // Check for available data. if(…
user963241
  • 6,758
  • 19
  • 65
  • 93
0
votes
1 answer

IServerXMLHTTPRequest vs WinHTTP Performance

I am trying to compare IServerXMLHTTPRequest and WinHTTP in regards to performance. I would like to know: What is the maximum limit of the data/file that can be sent? What is the transfer rate if the file to be sent is the maximum limit?
Ray
  • 627
  • 1
  • 7
  • 19
0
votes
0 answers

WinHTTP Website Login

I am trying to retrieve the source code of a web page using WinHTTP. Reading from this page: http://msdn.microsoft.com/en-us/library/windows/desktop/aa384110(v=vs.85).aspx I was able to come up with this code. The HTTP status code is 200 which means…
Quaxton Hale
  • 2,460
  • 5
  • 40
  • 71