trancexx Posted September 1, 2017 Author Share Posted September 1, 2017 3 hours ago, nhardel said: Okay, so I cleaned up the header as @trancexx suggested. That did help. I now get the following response. <HTML><HEAD><TITLE>Bad Request</TITLE> <META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD> <BODY><h2>Bad Request - Invalid Hostname</h2> <hr><p>HTTP Error 400. The request hostname is invalid.</p> </BODY></HTML> So that makes me assume that my I do need to push json array with my request. So I need a json udf. Here are my options: JSON_UDF Library (fully RFC4627-compliant) by Gabriel13 & A Non-StrictJSON UDF (JSMN) by Ward I am currently looking into the UDF by Gabriel13. It however seems very outdated and not much support on that thread if I do run into problems. Maybe it is just that easy, so don't flame me yet. I am looking into it. The second one by Ward seems to be the better option but by all accounts looks to be a dead project. The first post has all dead download links. Hoping someone might have a copy or could point me to something else that would work. No real question here, just looking for thoughts or ideas. Or the occasional "hey dumbass, the answer is right in front of you" comments. The way I read the response is that the server politely tells you that HTTP request isn't correct. If I'm right then go back to the start and get rid of manually setting header fields that should be just fine if left default. If I were you I'd configure the server this way... first add password to be able to use WinHttp,au3 as intended. Then change your code like this: ;... $sUserName = "admin" $sPassword = "whatever" $sHeader = 'Content-Type: application/json' $sTarget = "/SolarWinds/InformationService/v3/Json/Create/Orion.Nodes" Local $orion_QueryResponse = _WinHttpSimpleSSLRequest($hConnect, "POST", $sTarget, Default, $sDta, $sHeader, True, Default, $sUserName, $sPassword, 1) ;... ... then try it, and post the result. Nhardel 1 ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Nhardel Posted September 1, 2017 Share Posted September 1, 2017 Well that seem to do it. I made all of the changes that you suggested but then got a 401 unauthorized response. I jacked around with the username and password but didnt work. put that line back in the header and then everything worked. $sHeader = 'Authorization: Basic YWRtaW46' & @CRLF & _ 'Content-Type: application/json' $sTarget = "/SolarWinds/InformationService/v3/Json/Create/Orion.Nodes" $orion_QueryResponse = _WinHttpSimpleSSLRequest($hConnect,"Post", $sTarget, Default, $sDta, $sHeader, True, Default, Default, Default, 1) Response received: HTTP/1.1 200 OK Date: Fri, 01 Sep 2017 18:51:30 GMT Content-Length: 60 Content-Type: application/json Server: Microsoft-HTTPAPI/2.0 Verified that node was created on server. Link to comment Share on other sites More sharing options...
trancexx Posted September 1, 2017 Author Share Posted September 1, 2017 (edited) 58 minutes ago, nhardel said: Well that seem to do it. I made all of the changes that you suggested but then got a 401 unauthorized response. I jacked around with the username and password but didnt work. put that line back in the header and then everything worked. $sHeader = 'Authorization: Basic YWRtaW46' & @CRLF & _ 'Content-Type: application/json' $sTarget = "/SolarWinds/InformationService/v3/Json/Create/Orion.Nodes" $orion_QueryResponse = _WinHttpSimpleSSLRequest($hConnect,"Post", $sTarget, Default, $sDta, $sHeader, True, Default, Default, Default, 1) Response received: HTTP/1.1 200 OK Date: Fri, 01 Sep 2017 18:51:30 GMT Content-Length: 60 Content-Type: application/json Server: Microsoft-HTTPAPI/2.0 Verified that node was created on server. WinHttp.au3 doesn't support blank password. It was my choice made for security reasons. Just configure server to require password and the code will work. Blank password is gay. And if you let WinHttp set Authorization field then the code can handle any form of authorization demanded by the server, not only basic. That includes digest, ntlm, nego, and whatnot. Edited September 1, 2017 by trancexx ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Adele Posted December 25, 2017 Share Posted December 25, 2017 (edited) Is there a way to change headers during using _WinHttpSimpleFormFill() function? This is what did i try; #include "WinHttp.au3" Local $hInternet = _WinHttpOpen() Local $hConnect = _WinHttpConnect($hInternet, "example.com") Local $sAdditionalHeaders = "Cookie:PHPSESSID=123" Local $sReturn = _WinHttpSimpleFormFill($hConnect, "admin/product/add", Default, "username", "admin", $sAdditionalHeaders) _WinHttpCloseHandle($hInternet) _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($sReturn) Edited December 25, 2017 by Adele Link to comment Share on other sites More sharing options...
Adele Posted December 25, 2017 Share Posted December 25, 2017 (edited) One more question, i get error with that code (6 - invalid session handle passed) #include "WinHttp.au3" Local $hInternet = _WinHttpOpen() Local $sForm = '<form action="http://example.com" method="post" enctype="multipart/form-data">' & _ '<input type="file" name="file" />' & _ '</form>' Local $hConnect = $sForm Local $sReturn = _WinHttpSimpleFormFill($hConnect, Default, Default, "name:file", "C:\Users\User\Desktop\image.png") MsgBox(0, "Error Code: " & @error, "Return: " & $sReturn) _WinHttpCloseHandle($hInternet) _WinHttpCloseHandle($sReturn) Edited December 25, 2017 by Adele Link to comment Share on other sites More sharing options...
trancexx Posted December 26, 2017 Author Share Posted December 26, 2017 22 hours ago, Adele said: Is there a way to change headers during using _WinHttpSimpleFormFill() function? This is what did i try; #include "WinHttp.au3" Local $hInternet = _WinHttpOpen() Local $hConnect = _WinHttpConnect($hInternet, "example.com") Local $sAdditionalHeaders = "Cookie:PHPSESSID=123" Local $sReturn = _WinHttpSimpleFormFill($hConnect, "admin/product/add", Default, "username", "admin", $sAdditionalHeaders) _WinHttpCloseHandle($hInternet) _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($sReturn) What exactly is the problem? that should work. 21 hours ago, Adele said: One more question, i get error with that code (6 - invalid session handle passed) #include "WinHttp.au3" Local $hInternet = _WinHttpOpen() Local $sForm = '<form action="http://example.com" method="post" enctype="multipart/form-data">' & _ '<input type="file" name="file" />' & _ '</form>' Local $hConnect = $sForm Local $sReturn = _WinHttpSimpleFormFill($hConnect, Default, Default, "name:file", "C:\Users\User\Desktop\image.png") MsgBox(0, "Error Code: " & @error, "Return: " & $sReturn) _WinHttpCloseHandle($hInternet) _WinHttpCloseHandle($sReturn) You're passing Default keyword as second argument, instead of $hInternet. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
lpduy Posted January 2, 2018 Share Posted January 2, 2018 $path= "d:\hoso.xml" $file = fileopen($path) $data= fileread($file) $data=stringtoasciiarray($data,1) Hi Trancexx I has problem with winhttp request 5.1. +when they send request with data is bytes (c# byte[] byte Array) but server return err 205 (rong parameter). +i use code about. then send request but return fail. i think $data invailable with bytes array off server. can you help me how to read file to byte array and post data to server. In C# using system.net.http with httpclient must have set Maxresponebuffersize but in winhttp how to set the same this option. Thank you LpDuy Link to comment Share on other sites More sharing options...
Ascer Posted January 28, 2018 Share Posted January 28, 2018 Hello. I try to login on my Gmail Inbox via WinHttp. I have done 50% of process (enter email adress and press next). Next step required enter password and also press next. This i can not pass. In my opinion problem is in $sAction2. Using Live HTTP Headers i received this data durning second step (final login to gmail) POST /signin/challenge/sl/password HTTP/1.1 Host: accounts.google.com:443 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 Accept-Encoding: gzip, deflate, br Accept-Language: pl-PL,pl;q=0.9,en-US;q=0.8,en;q=0.7 Content-Type: application/x-www-form-urlencoded Cookie: CONSENT=YES+PL.pl+20150628-20-0; 1P_JAR=2018-1-24-15; NID=122=DzTr2OFvhgZQaiok08rlH2L8LKvRxo10hQmbkrx0n1iVRfTQOeThuGbY9x9e4igcZYhRnZC-KcKaVq1zu59JSw9Co2QA7NVKlVXA9yOWoVKZ7NOFq9OcpmxmqhtqL9TMVVbxPqVNJuLdjhxyTFRjTxvwwPHCruWAWq6Qmf0k62phpPFHYR5xe-QiyoQZ; ACCOUNT_CHOOSER=AFx_qI6F5ksoZUmQPMD3bjEjVlJRYo2LkBUEct2QALOkh1If4LuP2U4L4YaXuSNle5KP0b_nfBeW; GAPS=1:xUr80PGiUjGeBjiGsYIAsmOypnwQqz-2fxOrcT1VxRKuv03VefxM2Y3IBe5NY1AiFsyr71P6dux7jhUybEBoo2Gb3wWnIbzjTAVQBuDbqVo2gQ:JqQYqaHr8RO9oWrR Origin: null Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36 X-Chrome-Connected: mode=0,enable_account_consistency=false X-Chrome-UMA-Enabled: 1 X-Client-Data: CIu2yQEIorbJAQjBtskBCIqSygEI+pzKAQipncoBCKijygE= HTTP/1.1 302 alt-svc: hq=":443"; ma=2592000; quic=51303431; quic=51303339; quic=51303338; quic=51303337; quic=51303335,quic=":443"; ma=2592000; v="41,39,38,37,35" cache-control: no-cache, no-store, max-age=0, must-revalidate content-encoding: gzip content-length: 284 content-type: text/html; charset=UTF-8 date: Wed, 24 Jan 2018 16:39:37 GMT expires: Mon, 01 Jan 1990 00:00:00 GMT location: https://accounts.google.com/AccountChooser?Email=myemail%40gmail.com&continue=https%3A%2F%2Fwww.google.pl%2Fwebhp%3Fei%3DlqBoWseSO-KKmgWV45CwDQ%26yv%3D2%26rct%3Dj&hl=pl pragma: no-cache server: GSE set-cookie: GAPS=1:yMRhZscrWUUvDTajt2ZRaYXJASx9xouIxKCpiptr8ytyQrzy7i8oY-E3d0HOy1d2FYF-q0FmVc0nk4iVQhQAPv3hYIJ923GASx5ppLAsm-i7OQ:cHBZRHMjwa4o_J6V;Path=/;Expires=Fri, 24-Jan-2020 16:39:37 GMT;Secure;HttpOnly;Priority=HIGH status: 302 strict-transport-security: max-age=31536000; includeSubDomains x-content-type-options: nosniff x-frame-options: SAMEORIGIN x-xss-protection: 1; mode=block My code below. #include <WinHttp.au3> Func _GmailLogin($sEmail, $sPasswd) Local $hOpen = _WinHttpOpen() ; Open session Local $hConnect = _WinHttpConnect($hOpen, "https://accounts.google.com") ; Connection to make Local $sAction = "/ServiceLogin/identifier?hl=pl&passive=true&continue=https%3A%2F%2Fwww.google.pl%2Fwebhp%3Fei%3DlqBoWseSO-KKmgWV45CwDQ%26yv%3D2%26rct%3Dj&flowName=GlifWebSignIn&flowEntry=AddSession" Local $sRead = _WinHttpSimpleFormFill($hConnect, $sAction, Default, "name:Email", $sEmail) _StoreHtmlWebsite('Name.html', $sRead) ; Create a file *html with respond text Local $sAction2 = "/signin/challenge/sl/password" $sRead = _WinHttpSimpleFormFill($hConnect, $sAction2, Default, "name:Passwd", $sPasswd) _StoreHtmlWebsite('Password.html', $sRead) _WinHttpCloseHandle($hConnect) ;Close handles _WinHttpCloseHandle($hOpen) Return $sRead EndFunc Func _StoreHtmlWebsite($sFile, $sData) FileDelete($sFile) FileWrite($sFile, $sData) EndFunc ;==> Write copy of website to file *html _GmailLogin('myemail@gmail.com', 'mypassword') @trancexx Regards, Ascer Link to comment Share on other sites More sharing options...
Ascer Posted February 1, 2018 Share Posted February 1, 2018 (edited) I've working with this a little more. The problem now are cookies. To get full access into Gmail i need turn on Cookies in WinHttp. _GmailLogin("email@gmail.com", "yourPasswd") Func _GmailLogin($sEmail, $sPasswd) Local $hOpen = _WinHttpOpen() ; Open session Local Const $sAddress = "https://accounts.google.com/signin/challenge/sl/password" Local Const $sForm = _ '<form action="' & $sAddress & '" method="post" enctype="application/x-www-form-urlencoded">' & _ ' <input name="Email"/>' & _ ' <input name="Passwd"/>' & _ '</form>' Local $hConnect = $sForm Local $sRead = _WinHttpSimpleFormFill($hConnect, $hOpen, "index:0", _ "name:Email", $sEmail, _ "name:Passwd", $sPasswd) _StoreHtmlWebsite('Gmail.html', $sRead) _WinHttpCloseHandle($hConnect) ;Close handles _WinHttpCloseHandle($hOpen) Return $sRead EndFunc Func _StoreHtmlWebsite($sFile, $sData) FileDelete($sFile) FileWrite($sFile, $sData) EndFunc @trancexx Edited February 1, 2018 by Ascer Link to comment Share on other sites More sharing options...
MyEarth Posted February 13, 2018 Share Posted February 13, 2018 (edited) Hello @trancexx How i can save an image using WinHttp? In async mode, without wait to download. An example link: Many thanks for the help. In theory i don't need to save on the disk but loading directly on the GUI using GDI but i'll open another thread for this if i need help EDIT SOLVED with: https://github.com/dragana-r/autoit-winhttp/blob/master/WinHttp_Examples/_WinHttpSimpleBinaryConcat.au3 Edited February 13, 2018 by MyEarth coffeeturtle 1 Link to comment Share on other sites More sharing options...
Ascer Posted February 13, 2018 Share Posted February 13, 2018 Trancexx is ded bro. WinHttp default convert Binary to String from ResponseText so in my opinion better use InetRead function. Local $sBinaryImage = InetRead("http://maps.googleapis.com/maps/api/staticmap?center=10.82,14.34&zoom=12&size=465x365&markers=size:mid%7Ccolor:red%7C40.82,14.34") ss26 1 Link to comment Share on other sites More sharing options...
sampy Posted April 1, 2018 Share Posted April 1, 2018 Hello everybody! I want to make a script for IQ Option Autologin: https://eu.iqoption.com/it I have try to find something but i can get only the header and i cant login in this site I have find also a API for login with Python: Quote # -*- coding: utf-8 -*- """Module for IQ Option http login resource.""" from src.api.iqoption.http.resource import Resource class Login(Resource): """Class for IQ option login resource.""" # pylint: disable=too-few-public-methods url = "login" def _post(self, data=None, headers=None): """Send get request for IQ Option API login http resource. :returns: The instace of :class:`requests.Response`. """ return self.send_http_request("POST", data=data, headers=headers) def __call__(self, username, password): """Method to get IQ Option API login http request. :param str username: The username of a IQ Option server. :param str password: The password of a IQ Option server. :returns: The instance of :class:`requests.Response`. """ data = {"email": username, "password": password} return self._post(data=data) Someone know how works? Thanks everybody and happy coding Link to comment Share on other sites More sharing options...
uncommon Posted June 28, 2018 Share Posted June 28, 2018 Question about winHTTP I am encountering a Error ERROR_WINHTTP_CONNECTION_ERROR = 12030 when I connect to a certain website via SSL via _WinHttpSimpleSSLRequest. I read the documentation about this error. It states... "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." So my first thought is its a version compatibility issue, but it seems to work fine on my windows 10 computer, but not my windows 7. I made sure there were not funky router settings, windows firewall was turned off, no other firewalls. I am using the same script with the same version of autoit on both computers. I also check winhttp.dll on both computers and they are appear in the same directories with the same last date modified. Here is a small sample of my script. Local $POSTHeader, $sResponse = "{}" Local Const $AsanaAPIKey = "some hash goes here" $hOpen = _WinHttpOpen() $hConnect = _WinHttpConnect($hOpen, "http://app.asana.com/") $sRead = _WinHttpSimpleSSLRequest($hConnect, "GET", "api/1.0/projects", Default, $WINHTTP_NO_ADDITIONAL_HEADERS, "Authorization: Bearer " & $AsanaAPIKey) _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen) So the only variables I can think of is the OS version. My question is, am I doing this wrong or is there some kind of workaround that I am not thinking of. Thank you for your time. No problem can withstand the assault of sustained thinking.Voltaire _Array2HTMLTable(), _IEClassNameGetCollection(), _IEquerySelectorAll() Link to comment Share on other sites More sharing options...
trancexx Posted June 29, 2018 Author Share Posted June 29, 2018 15 hours ago, uncommon said: Question about winHTTP I am encountering a Error ERROR_WINHTTP_CONNECTION_ERROR = 12030 when I connect to a certain website via SSL via _WinHttpSimpleSSLRequest. I read the documentation about this error. It states... "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." So my first thought is its a version compatibility issue, but it seems to work fine on my windows 10 computer, but not my windows 7. I made sure there were not funky router settings, windows firewall was turned off, no other firewalls. I am using the same script with the same version of autoit on both computers. I also check winhttp.dll on both computers and they are appear in the same directories with the same last date modified. Here is a small sample of my script. Local $POSTHeader, $sResponse = "{}" Local Const $AsanaAPIKey = "some hash goes here" $hOpen = _WinHttpOpen() $hConnect = _WinHttpConnect($hOpen, "http://app.asana.com/") $sRead = _WinHttpSimpleSSLRequest($hConnect, "GET", "api/1.0/projects", Default, $WINHTTP_NO_ADDITIONAL_HEADERS, "Authorization: Bearer " & $AsanaAPIKey) _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen) So the only variables I can think of is the OS version. My question is, am I doing this wrong or is there some kind of workaround that I am not thinking of. Thank you for your time. Maybe it's this. Try the suggestion from there. uncommon 1 ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
uncommon Posted June 29, 2018 Share Posted June 29, 2018 Thanks tranceXX I will give it a try. In the mean time I have made a windows 7 and 10 images and I am switching back and forth with I need to @__@ No problem can withstand the assault of sustained thinking.Voltaire _Array2HTMLTable(), _IEClassNameGetCollection(), _IEquerySelectorAll() Link to comment Share on other sites More sharing options...
uncommon Posted July 2, 2018 Share Posted July 2, 2018 On 6/29/2018 at 1:11 AM, trancexx said: Maybe it's this. Try the suggestion from there. Close very close. To clarify You are suggesting I use _WinHttpSetOption($hOpen, $WINHTTP_OPTION_SECURE_PROTOCOLS, $WINHTTP_FLAG_SECURE_PROTOCOL_ALL) I had to look up WINHTTP_FLAG_SECURE_PROTOCOL_ALL (The value is 84 I think) and here it is as described by Microsoft. "Sets an unsigned long integer value that specifies which secure protocols are acceptable. By default only SSL3 and TLS1 are enabled in Windows 7 and Windows 8. By default only SSL3, TLS1.0, TLS1.1, and TLS1.2 are enabled in Windows 8.1 and Windows 10. The value can be a combination of one or more of the following values." This coincides with the symptoms I have been having but when I tried it out, I still was not getting anything back from WinHTTP. I'll try some more troubleshooting, or maybe there is a way to set windows to enable TLS1.1, and TLS1.2... No problem can withstand the assault of sustained thinking.Voltaire _Array2HTMLTable(), _IEClassNameGetCollection(), _IEquerySelectorAll() Link to comment Share on other sites More sharing options...
trancexx Posted July 2, 2018 Author Share Posted July 2, 2018 2 hours ago, uncommon said: Close very close. To clarify You are suggesting I use _WinHttpSetOption($hOpen, $WINHTTP_OPTION_SECURE_PROTOCOLS, $WINHTTP_FLAG_SECURE_PROTOCOL_ALL) I had to look up WINHTTP_FLAG_SECURE_PROTOCOL_ALL (The value is 84 I think) and here it is as described by Microsoft. "Sets an unsigned long integer value that specifies which secure protocols are acceptable. By default only SSL3 and TLS1 are enabled in Windows 7 and Windows 8. By default only SSL3, TLS1.0, TLS1.1, and TLS1.2 are enabled in Windows 8.1 and Windows 10. The value can be a combination of one or more of the following values." This coincides with the symptoms I have been having but when I tried it out, I still was not getting anything back from WinHTTP. I'll try some more troubleshooting, or maybe there is a way to set windows to enable TLS1.1, and TLS1.2... Constants are defined inside WinHttpConstants.au3. ;... Global Const $WINHTTP_FLAG_SECURE_PROTOCOL_SSL2 = 0x00000008 Global Const $WINHTTP_FLAG_SECURE_PROTOCOL_SSL3 = 0x00000020 Global Const $WINHTTP_FLAG_SECURE_PROTOCOL_TLS1 = 0x00000080 Global Const $WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1 = 0x00000200 Global Const $WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2 = 0x00000800 Global Const $WINHTTP_FLAG_SECURE_PROTOCOL_ALL = 0x000000A8 ;... If you need TLS1.1 and TLS1_2 just BitOR them with the other. uncommon 1 ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
DuyMinh93 Posted July 4, 2018 Share Posted July 4, 2018 Dear trancexx, can I get the cookies from cache of winhttp? (Not cookies in the header), because i see winhttp can store and use it from the previous request without filling cookies (ex: we request to login autoitscript.com and we dont need filling cookies to next request cuz winhttp help us to do this). I want to ask this because sometime, cookies in the header can missing something, after i login the gmail, i can request many many after that, but when i extract this cookies from header to using this to request again, this dont work... Sorry to bad explain... My english is very week... Link to comment Share on other sites More sharing options...
uncommon Posted July 10, 2018 Share Posted July 10, 2018 On 7/2/2018 at 1:51 PM, trancexx said: Constants are defined inside WinHttpConstants.au3. ;... Global Const $WINHTTP_FLAG_SECURE_PROTOCOL_SSL2 = 0x00000008 Global Const $WINHTTP_FLAG_SECURE_PROTOCOL_SSL3 = 0x00000020 Global Const $WINHTTP_FLAG_SECURE_PROTOCOL_TLS1 = 0x00000080 Global Const $WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1 = 0x00000200 Global Const $WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2 = 0x00000800 Global Const $WINHTTP_FLAG_SECURE_PROTOCOL_ALL = 0x000000A8 ;... If you need TLS1.1 and TLS1_2 just BitOR them with the other. Well my first problem was I had and older version of WinHTTP UDF. Updated my files and then tried _WinHttpSetOption($hOpen, $WINHTTP_OPTION_SECURE_PROTOCOLS, $WINHTTP_FLAG_SECURE_PROTOCOL_ALL) Not much luck there. Then I tried _WinHttpSetOption($hOpen, $WINHTTP_OPTION_SECURE_PROTOCOLS, BitOR($WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1,$WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2)) And suddenly my WinHttp.dll came alive and it worked. Great Scott! Thank you Tranxx. You are both a lady, and a Bad**s Programmer. Did you know that? There is a great need for more people like you. No problem can withstand the assault of sustained thinking.Voltaire _Array2HTMLTable(), _IEClassNameGetCollection(), _IEquerySelectorAll() Link to comment Share on other sites More sharing options...
HamidZaeri Posted November 2, 2018 Share Posted November 2, 2018 (edited) Hi I have two questions: 1. What would be the equivalent of this code in winhttp? With ObjCreate("winhttp.winhttprequest.5.1") .SetProxy(2, '127.0.0.1:8080') .Open("POST", 'https://api.server.ir/v2/content/get', False) .SetRequestHeader("Content-Type", 'application/x-www-form-urlencoded') .SetRequestHeader("Connection", 'Keep-Alive') .SetRequestHeader("Accept-Encoding", 'gzip') .SetRequestHeader("User-Agent", 'okhttp/3.10.0') .SetTimeouts(20000,40000,20000,20000) .Send($req[$cod][0]) InputBox('Amount','How many?',.ResponseText) EndWith 2. Does winhttp udf support for encoded (compressed) response? With the above code, I receive 2-4 strange character as ResponseText! or this error: Quote AutoIt Error --------------------------- Line 34 (File "C:\act\B135.au3"): InputBox('Amount','How many?',.ResponseText) InputBox('Amount','How many?',^ ERROR Error: The requested action with this object has failed. --------------------------- What about this udf? or any other solution? Edited January 24, 2020 by HamidZaeri Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now