• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Can't get response from an api using xmlhttp requests

shahin

Active Member
Is there any way I can fetch response from this api https://api.nasdaq.com/api/company/CTXS/earnings-surprise using xmlhttp requests? I've tried like the following but the script keeps buffering when it is made to run.

Code:
Sub GetResponse()
    Const URL$ = "https://api.nasdaq.com/api/company/CTXS/earnings-surprise"
    Dim Http As Object
   
    Set Http = CreateObject("MSXML2.XMLHTTP")

    With Http
        .Open "GET", URL, False
        .setRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.128 Safari/537.36"
        .send
        MsgBox .responseText
    End With
End Sub
 
You are always the lifesaver. It's a long time since I found you in the loop. Thanks a lot.
 
I'm on Moon but people ask for Mars and 'dynamicly' but without any sense of humor …​
 
Back
Top