When getting ready to develop a pure vba simple javascript engine today, I came across something really interesting. I would anticipate receiving what it outputs in MsgBox if I pulled the content via http. the website's plaintext code with javascript tags, etc. I can make that work. Nevertheless, if it only outputs in the manner I require to the msgbox or a wscript object popup, I am unable to use it. But, the outcome is what you see in debug if you attempt to print it to a file, cell, etc. print.
The response in the messagebox contains all of the website's javascript and html code, just as it would appear if you viewed the page source in a browser. We're delighted you wish to use your Quickbase more, says the response in a new HTML format in debug.print. without utilising the quickbase api, trying to scrape a quickbase page.
I'm quite interested to know what's happening. different types of variables? VarType makes no mention of that. It cannot be a problem on the server's end. Not to my knowledge. I've read the documentation, but I still don't understand. What is happening?
grab = CreateObject(WinHttp.WinHttpRequest.5.1")
grab.Open
.SetRequestHeaders "irrelevant", "Really doesn't matter what I'm setting as my headers"
grab.send
' Here's the weird part...
resptext = grab.responseText
respbody = grab.responseBody
debug.print(resptext)
MsgBox(resptext)
string_of_byte_array = StrConv(respbody, vbUnicode)
debug.print(string_of_byte_array)
MsgBox(string_of_byte_array)
Appreciate any clarification you can offer.