winhttprequest

VBA download form URL with login that redirect to another one

删除回忆录丶 提交于 2021-02-08 07:20:37
问题 the website requires login then redirect you to other url then download the file this function works fine with url with no redirction but not with my case Function DownloadFile(URL As String, Path As String, UserName As String, Password As String) As Boolean DownloadFile = False Dim WinHttpReq As Object Set WinHttpReq = CreateObject("MSXML2.ServerXMLHTTP.6.0") WinHttpReq.Open "GET", URL, False, UserName, Password WinHttpReq.send Set oStream = CreateObject("ADODB.Stream") oStream.Open oStream

VBA download form URL with login that redirect to another one

淺唱寂寞╮ 提交于 2021-02-08 07:18:47
问题 the website requires login then redirect you to other url then download the file this function works fine with url with no redirction but not with my case Function DownloadFile(URL As String, Path As String, UserName As String, Password As String) As Boolean DownloadFile = False Dim WinHttpReq As Object Set WinHttpReq = CreateObject("MSXML2.ServerXMLHTTP.6.0") WinHttpReq.Open "GET", URL, False, UserName, Password WinHttpReq.send Set oStream = CreateObject("ADODB.Stream") oStream.Open oStream

How to decompress http responses in vba excel?

笑着哭i 提交于 2021-02-07 11:10:54
问题 How to decompress/decode gzip/deflate http/s responses in vba? Winhttp5.1 does not automatically decompress/decode gzipped or deflate responses. MSxml2 does decompress/decode responses, but does not allow custom headers or referers. 回答1: The following code can be used to decompress any compressed data, by calling the Inflate() Function from the Inflate module. Full inflate module code is given below. Of course you can change the module name and the function name but do it carefully.

Proxy authentication required (http error 407) with WinHttpRequest and proxy with integrated Windows authentication and https

二次信任 提交于 2020-06-16 17:08:53
问题 I'm trying to access an external website from my company network using WinHttpRequest from VBA. The company has a proxy server that requires integrated Windows authentication. The following code works if I try to access a URL with plain http, but I get http status code 407 - proxy authentication required if I try to access a URL with https. What do I need to do to make the code work with https? Sub a() Dim w As New WinHttp.WinHttpRequest 'set proxy w.SetProxy 2, "myproxy:8080" 'use integrated

Proxy authentication required (http error 407) with WinHttpRequest and proxy with integrated Windows authentication and https

橙三吉。 提交于 2020-06-16 17:08:32
问题 I'm trying to access an external website from my company network using WinHttpRequest from VBA. The company has a proxy server that requires integrated Windows authentication. The following code works if I try to access a URL with plain http, but I get http status code 407 - proxy authentication required if I try to access a URL with https. What do I need to do to make the code work with https? Sub a() Dim w As New WinHttp.WinHttpRequest 'set proxy w.SetProxy 2, "myproxy:8080" 'use integrated

Proxy authentication required (http error 407) with WinHttpRequest and proxy with integrated Windows authentication and https

我只是一个虾纸丫 提交于 2020-06-16 17:06:32
问题 I'm trying to access an external website from my company network using WinHttpRequest from VBA. The company has a proxy server that requires integrated Windows authentication. The following code works if I try to access a URL with plain http, but I get http status code 407 - proxy authentication required if I try to access a URL with https. What do I need to do to make the code work with https? Sub a() Dim w As New WinHttp.WinHttpRequest 'set proxy w.SetProxy 2, "myproxy:8080" 'use integrated

Problem adding JSON content to WinHttpRequest POST request in classic ASP

扶醉桌前 提交于 2020-04-16 02:49:09
问题 I am trying to retrieve data using an NHS API and the instructions are as follows... Endpoint https://api.nhs.uk/service-search/search?api-version=1 Method POST Headers Content-Type: application/json subscription-key: MYKEYHERE Body { "filter": "OrganisationTypeID eq 'PHA'", "orderby": "OrganisationName", "top": 25, "skip": 0, "count": true } Following the answer here How can I post data using cURL in asp classic? I tried this... <% Dim http: Set http = Server.CreateObject("WinHttp

How to do logins using the WinHttpRequest COM?

一曲冷凌霜 提交于 2020-01-28 07:56:31
问题 You can see lots of people automating things on websites using mouseclick and keystroke simulation on browser windows or using the IE COM, but for some applications you don't want your application to take hundrets of megabytes of RAM and use loads of CPU power to render the website etc. So the question is: How to do logins to websites / webservices using AutoHotkey without a browser but using the WinHttpRequest COM? 回答1: I already posted this on the AHK forums, but I think the information is

receiving 12030 at WinHttpReceiveResponse

耗尽温柔 提交于 2020-01-20 09:37:20
问题 I just got into using SSL with winhttp. I am receiving ERROR_WINHTTPCONNECTION_ERROR in MSDN the docs it says, The connection with the server has been reset or terminated, or an incompatible SSL protocol was encountered. For example, WinHTTP version 5.1 does not support SSL2 unless the client specifically enables it. What could be the reason ? I tried different links. gcc myFile.c -o myFile.exe -lwinhttp is the arg. #include <stdio.h> #include <string.h> #include <windows.h> #include <WinHttp

receiving 12030 at WinHttpReceiveResponse

本秂侑毒 提交于 2020-01-20 09:36:11
问题 I just got into using SSL with winhttp. I am receiving ERROR_WINHTTPCONNECTION_ERROR in MSDN the docs it says, The connection with the server has been reset or terminated, or an incompatible SSL protocol was encountered. For example, WinHTTP version 5.1 does not support SSL2 unless the client specifically enables it. What could be the reason ? I tried different links. gcc myFile.c -o myFile.exe -lwinhttp is the arg. #include <stdio.h> #include <string.h> #include <windows.h> #include <WinHttp