haijie1223 Posted February 25, 2018 Share Posted February 25, 2018 (edited) Local $oHttp = ObjCreate("WinHttp.WinHttpRequest.5.1") $oHttp.Open('GET', 'http://www.163.com', True) $oHttp.Send() ConsoleWrite(BinaryToString($oHttp.ResponseBody(), 4)) after 3.3.14.0 version,the error is exist。bug? Edited February 26, 2018 by Melba23 Amended title Link to comment Share on other sites More sharing options...
TheXman Posted February 25, 2018 Share Posted February 25, 2018 (edited) 10 hours ago, haijie1223 said: after 3.3.14.0 version,the error is exist。bug? The bug appears to be in your code snippet. I seriously doubt that prior to 3.3.14.0 you would not have gotten the same error. Your Open method requests Async mode. If you change it to Synchronous mode, it works just fine. Global $oHttp = ObjCreate("WinHttp.WinHttpRequest.5.1") $oHttp.Open("GET", "https://www.google.com", False) $oHttp.Send() ConsoleWrite(BinaryToString($oHttp.ResponseBody, 4)) Edited February 25, 2018 by TheXman CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
Zedna Posted February 26, 2018 Share Posted February 26, 2018 As far as I know ResponseBody is property not function, so you have to use ResponseBody instead of wrong ResponseBody() Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
haijie1223 Posted February 26, 2018 Author Share Posted February 26, 2018 22 hours ago, TheXman said: 该错误似乎在您的代码片段中。我严重怀疑在3.3.14.0之前你不会得到同样的错误。您的Open方法请求异步模式。如果将其更改为同步模式,则工作正常。 全局 $ oHttp = ObjCreate(“WinHttp.WinHttpRequest.5.1” ) $ oHttp 。打开(“GET” , “https://www.google.com” , False) $ oHttp 。发送() ConsoleWrite(BinaryToString($ oHttp 。ResponseBody , 4 )) 1 hour ago, Zedna said: 据我所知,ResponseBody属性不是函数,所以你必须使用ResponseBody而不是错误的ResponseBody() Thanks!It's My Careless。 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