winhttp

WinHTTP - The connection with the server was terminated abnormally

别来无恙 提交于 2021-02-10 18:52:54
问题 I import WinHTTP and try execute a request in a https url, like this: function TForm1.GetPage(AURL: String): String; var WinHttpRequest: IWinHTTPRequest; begin CoInitialize(nil); try WinHttpRequest := CoWinHttpRequest.Create; WinHttpRequest.Open('GET', AURL, False); WinHttpRequest.Send(EmptyParam); Result := WinHttpRequest.ResponseText; finally WinHTTPRequest := nil; CoUninitialize; end; end; It works in same pages (ex: https://www.google.com), but not in others (ex: https://sourceforge.net),

MSXML2.XMLHTTP fails to send request cookie header

风流意气都作罢 提交于 2021-01-29 20:47:27
问题 I'm trying to create some automated web searches in this website using Excel VBA but in order to use it, you need to agree with it's terms and conditions. The website then stores your agreement in a cookie "agree=True". But, while using MSXML2.XMLHTTP , I'm not able to set the cookie request header using setRequestHeader , so it redirects me to the usage agree page on every request. I know there's a bug using MSXML2 as stated here, but I don't see how I can use the workaround provided in the

How do I upload a zip file via HTTP post using VBA?

百般思念 提交于 2020-02-22 06:33:05
问题 This question has been asked many times by others in some form or another but most remained unanswered or the given answer is "Use C#, duh!", which incidentally, is a non-answer. ;-) I want to upload a zip file to a web server via VBA. The server side code already exists and works well; it accepts zip files via manual form upload and does something with the contents of the zip file. The theory is, I plan to transform the binary contents of the zip file into a HTTP request string and send it

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

msdn upload image with winhttp c++

一曲冷凌霜 提交于 2020-01-14 03:21:08
问题 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 someone point out where i am wrong c++ code: int _tmain(int argc, _TCHAR* argv[]) { HINTERNET hSession = NULL, hConnect = NULL, hRequest = NULL; BOOL bResults = FALSE; FILE *pFile; long lSize; char *buffer; size_t result; pFile = fopen("blog.jpg", "rb");

How to parse line by line WinHTTP response: UTF-8 encoded CSV?

跟風遠走 提交于 2020-01-09 08:01:07
问题 As the next step for my happily solved problem (Not understanding why WinHTTP does NOT authenticate certain HTTPS resource) I need to prettily parse obtained CSV. At the moment I use the following solution: If HTTPReq.Status = 200 Then If FSO.FileExists(CSV_Path) = True Then FSO.DeleteFile (CSV_Path) Set FileStream = CreateObject("ADODB.Stream") FileStream.Open FileStream.Type = 1 FileStream.Write HTTPReq.responseBody FileStream.SaveToFile (CSV_Path) FileStream.Close ActiveWorkbook