VBA HTTP request to API with JSON body returns empty array (MSXML2.XMLHTTP in Excel)Excel 2010 VBA - XMLHTTPExcel VBA MSXML2.XMLHTTP not working in company networkExcel VBA Msxml2.XMLHTTP.6.0 vs Msxml2.ServerXMLHTTP.6.0VBA - XMLHTTP and WinHttp request speedVBA Macros MSXML2.XMLHTTP LoginVBA Excel MSXML2.XMLHTTP getelementsbytagname() not workingWeb Scraping using VBA and MSXML2.XMLHTTP libraryExcel VBA XMLHTTPVBA crashing with loop of xmlhttp requests

Infinitely many hats

Do you play the upbeat when beginning to play a series of notes, and then after?

How is character development a major role in the plot of a story

What are the problems in teaching guitar via Skype?

How can i have text between brackets in equation with respect to some criterion?

The qvolume of an integer

Differences between “pas vrai ?”, “c’est ça ?”, “hein ?”, and “n’est-ce pas ?”

What is the best linguistic term for describing the kw > p / gw > b change, and its usual companion s > h

Boots: Does light damage affect waterproofing?

Can a non-EU citizen travel within schengen zone freely without passport?

Why doesn't the Earth's acceleration towards the Moon accumulate to push the Earth off its orbit?

Mother abusing my finances

Can a wire having a 610-670 THz (frequency of blue light) AC frequency supply, generate blue light?

Does the Thunderwave spell push back a Cloud of Daggers?

Looking after a wayward brother in mother's will

What does uniform continuity mean exactly?

What does "tea juice" mean in this context?

What are these (utility?) boxes at the side of the house?

Could IPv6 make NAT / port numbers redundant?

Apparent Ring of Craters on the Moon

Beginner's snake game using PyGame

How could Catholicism have incorporated witchcraft into its dogma?

How did early x86 BIOS programmers manage to program full blown TUIs given very few bytes of ROM/EPROM?

Why is "division by zero" valid here?



VBA HTTP request to API with JSON body returns empty array (MSXML2.XMLHTTP in Excel)


Excel 2010 VBA - XMLHTTPExcel VBA MSXML2.XMLHTTP not working in company networkExcel VBA Msxml2.XMLHTTP.6.0 vs Msxml2.ServerXMLHTTP.6.0VBA - XMLHTTP and WinHttp request speedVBA Macros MSXML2.XMLHTTP LoginVBA Excel MSXML2.XMLHTTP getelementsbytagname() not workingWeb Scraping using VBA and MSXML2.XMLHTTP libraryExcel VBA XMLHTTPVBA crashing with loop of xmlhttp requests






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















Update: SOLVED --> Look below for answer.



Update:
At the Microsoft docs i can see that when open method is called with Async=false, the response might not return if "the protocol stack times out", however I have not been able to read up on the timeout timers.
https://docs.microsoft.com/en-us/previous-versions/windows/embedded/ms931177%28v%3dmsdn.10%29
Not really sure if it's related or not.



I'm trying to retrieve a JSON response object through VersionOne query API.
When i try to read the responseText in VBA I receive an empty array, however the exact same request returns correct data from PostMan. I get an HTTP 200 code response, but no data in the response body.



The reason for doing it in VBA and Excel is that the data needs to be analalyzed in a pre-existing Excel model.
I've tried different auth possibilities, both OAUTH and Basic.



This is the VBA code



Option Explicit
Sub Test_LateBinding()

Dim objRequest As Object
Dim strUrl As String
Dim strResponse As String
Dim body As String
Dim strResponseHeaders As String
Dim allResponseHeader As String

Set objRequest = CreateObject("MSXML2.XMLHTTP")
strUrl = "https://endpoint"
body = " ""from"": ""Epic"",""select"": []"
'with basic'
With objRequest
.Open "GET", strUrl, False, "XXXX", "XXXX"
.SetRequestHeader "Content-Type", "application/json"
.Send body
strResponseHeaders = .StatusText
strResponse = .ResponseText
allResponseHeader = .GetAllResponseHeaders
End With
Debug.Print body
Debug.Print allResponseHeader
Debug.Print strResponse

End Sub


This is my console output:



OK
Content-Type: application/json; charset=utf-8
Content-Length: 2
X-Content-Type-Options: nosniff
V1-MemberID: skatteministeriet/120267
Strict-Transport-Security: max-age=31536000; includeSubdomains
X-Robots-Tag: noindex
VersionOne: Ultimate/19.0.3.29; 0
X-Instart-Request-ID: 3912039762705832388:SEN01-NPPRY25:1553377406:0

[]


This is the PostMan response headers:
PostMan response headers



This is the URL and request JSON body:
URL and request body










share|improve this question
























  • No, it's supposed to be a get request. :)

    – Hassassin
    Mar 24 at 10:57











  • Can you point to which example in the guidance aligns with your use case? The closest I found so far is a POST request here: community.versionone.com/VersionOne_Connect/Developer_Library/…

    – QHarr
    Mar 24 at 11:52






  • 1





    Endpoint introduction community.versionone.com/VersionOne_Connect/Developer_Library/… Endpoint tour community.versionone.com/VersionOne_Connect/Developer_Library/… Tbh the documentation is horribly organized, it's structured so wierd...

    – Hassassin
    Mar 24 at 12:33







  • 1





    Could you please provide a valid URL? Also, add a screenshot of the working OK PostMan request with all headers and parameters to the question (or the link).

    – omegastripes
    Mar 24 at 23:45












  • The valid URL for the endpoint will be troublesome to post, since the endpoint is organisation independant and therefore "non-disclosable". However, screenshots of the PostMan request i s possible. I will update this post with it.

    – Hassassin
    Mar 25 at 8:57

















1















Update: SOLVED --> Look below for answer.



Update:
At the Microsoft docs i can see that when open method is called with Async=false, the response might not return if "the protocol stack times out", however I have not been able to read up on the timeout timers.
https://docs.microsoft.com/en-us/previous-versions/windows/embedded/ms931177%28v%3dmsdn.10%29
Not really sure if it's related or not.



I'm trying to retrieve a JSON response object through VersionOne query API.
When i try to read the responseText in VBA I receive an empty array, however the exact same request returns correct data from PostMan. I get an HTTP 200 code response, but no data in the response body.



The reason for doing it in VBA and Excel is that the data needs to be analalyzed in a pre-existing Excel model.
I've tried different auth possibilities, both OAUTH and Basic.



This is the VBA code



Option Explicit
Sub Test_LateBinding()

Dim objRequest As Object
Dim strUrl As String
Dim strResponse As String
Dim body As String
Dim strResponseHeaders As String
Dim allResponseHeader As String

Set objRequest = CreateObject("MSXML2.XMLHTTP")
strUrl = "https://endpoint"
body = " ""from"": ""Epic"",""select"": []"
'with basic'
With objRequest
.Open "GET", strUrl, False, "XXXX", "XXXX"
.SetRequestHeader "Content-Type", "application/json"
.Send body
strResponseHeaders = .StatusText
strResponse = .ResponseText
allResponseHeader = .GetAllResponseHeaders
End With
Debug.Print body
Debug.Print allResponseHeader
Debug.Print strResponse

End Sub


This is my console output:



OK
Content-Type: application/json; charset=utf-8
Content-Length: 2
X-Content-Type-Options: nosniff
V1-MemberID: skatteministeriet/120267
Strict-Transport-Security: max-age=31536000; includeSubdomains
X-Robots-Tag: noindex
VersionOne: Ultimate/19.0.3.29; 0
X-Instart-Request-ID: 3912039762705832388:SEN01-NPPRY25:1553377406:0

[]


This is the PostMan response headers:
PostMan response headers



This is the URL and request JSON body:
URL and request body










share|improve this question
























  • No, it's supposed to be a get request. :)

    – Hassassin
    Mar 24 at 10:57











  • Can you point to which example in the guidance aligns with your use case? The closest I found so far is a POST request here: community.versionone.com/VersionOne_Connect/Developer_Library/…

    – QHarr
    Mar 24 at 11:52






  • 1





    Endpoint introduction community.versionone.com/VersionOne_Connect/Developer_Library/… Endpoint tour community.versionone.com/VersionOne_Connect/Developer_Library/… Tbh the documentation is horribly organized, it's structured so wierd...

    – Hassassin
    Mar 24 at 12:33







  • 1





    Could you please provide a valid URL? Also, add a screenshot of the working OK PostMan request with all headers and parameters to the question (or the link).

    – omegastripes
    Mar 24 at 23:45












  • The valid URL for the endpoint will be troublesome to post, since the endpoint is organisation independant and therefore "non-disclosable". However, screenshots of the PostMan request i s possible. I will update this post with it.

    – Hassassin
    Mar 25 at 8:57













1












1








1


2






Update: SOLVED --> Look below for answer.



Update:
At the Microsoft docs i can see that when open method is called with Async=false, the response might not return if "the protocol stack times out", however I have not been able to read up on the timeout timers.
https://docs.microsoft.com/en-us/previous-versions/windows/embedded/ms931177%28v%3dmsdn.10%29
Not really sure if it's related or not.



I'm trying to retrieve a JSON response object through VersionOne query API.
When i try to read the responseText in VBA I receive an empty array, however the exact same request returns correct data from PostMan. I get an HTTP 200 code response, but no data in the response body.



The reason for doing it in VBA and Excel is that the data needs to be analalyzed in a pre-existing Excel model.
I've tried different auth possibilities, both OAUTH and Basic.



This is the VBA code



Option Explicit
Sub Test_LateBinding()

Dim objRequest As Object
Dim strUrl As String
Dim strResponse As String
Dim body As String
Dim strResponseHeaders As String
Dim allResponseHeader As String

Set objRequest = CreateObject("MSXML2.XMLHTTP")
strUrl = "https://endpoint"
body = " ""from"": ""Epic"",""select"": []"
'with basic'
With objRequest
.Open "GET", strUrl, False, "XXXX", "XXXX"
.SetRequestHeader "Content-Type", "application/json"
.Send body
strResponseHeaders = .StatusText
strResponse = .ResponseText
allResponseHeader = .GetAllResponseHeaders
End With
Debug.Print body
Debug.Print allResponseHeader
Debug.Print strResponse

End Sub


This is my console output:



OK
Content-Type: application/json; charset=utf-8
Content-Length: 2
X-Content-Type-Options: nosniff
V1-MemberID: skatteministeriet/120267
Strict-Transport-Security: max-age=31536000; includeSubdomains
X-Robots-Tag: noindex
VersionOne: Ultimate/19.0.3.29; 0
X-Instart-Request-ID: 3912039762705832388:SEN01-NPPRY25:1553377406:0

[]


This is the PostMan response headers:
PostMan response headers



This is the URL and request JSON body:
URL and request body










share|improve this question
















Update: SOLVED --> Look below for answer.



Update:
At the Microsoft docs i can see that when open method is called with Async=false, the response might not return if "the protocol stack times out", however I have not been able to read up on the timeout timers.
https://docs.microsoft.com/en-us/previous-versions/windows/embedded/ms931177%28v%3dmsdn.10%29
Not really sure if it's related or not.



I'm trying to retrieve a JSON response object through VersionOne query API.
When i try to read the responseText in VBA I receive an empty array, however the exact same request returns correct data from PostMan. I get an HTTP 200 code response, but no data in the response body.



The reason for doing it in VBA and Excel is that the data needs to be analalyzed in a pre-existing Excel model.
I've tried different auth possibilities, both OAUTH and Basic.



This is the VBA code



Option Explicit
Sub Test_LateBinding()

Dim objRequest As Object
Dim strUrl As String
Dim strResponse As String
Dim body As String
Dim strResponseHeaders As String
Dim allResponseHeader As String

Set objRequest = CreateObject("MSXML2.XMLHTTP")
strUrl = "https://endpoint"
body = " ""from"": ""Epic"",""select"": []"
'with basic'
With objRequest
.Open "GET", strUrl, False, "XXXX", "XXXX"
.SetRequestHeader "Content-Type", "application/json"
.Send body
strResponseHeaders = .StatusText
strResponse = .ResponseText
allResponseHeader = .GetAllResponseHeaders
End With
Debug.Print body
Debug.Print allResponseHeader
Debug.Print strResponse

End Sub


This is my console output:



OK
Content-Type: application/json; charset=utf-8
Content-Length: 2
X-Content-Type-Options: nosniff
V1-MemberID: skatteministeriet/120267
Strict-Transport-Security: max-age=31536000; includeSubdomains
X-Robots-Tag: noindex
VersionOne: Ultimate/19.0.3.29; 0
X-Instart-Request-ID: 3912039762705832388:SEN01-NPPRY25:1553377406:0

[]


This is the PostMan response headers:
PostMan response headers



This is the URL and request JSON body:
URL and request body







excel vba api web-scraping xmlhttprequest






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 28 at 14:24







Hassassin

















asked Mar 24 at 9:25









HassassinHassassin

62




62












  • No, it's supposed to be a get request. :)

    – Hassassin
    Mar 24 at 10:57











  • Can you point to which example in the guidance aligns with your use case? The closest I found so far is a POST request here: community.versionone.com/VersionOne_Connect/Developer_Library/…

    – QHarr
    Mar 24 at 11:52






  • 1





    Endpoint introduction community.versionone.com/VersionOne_Connect/Developer_Library/… Endpoint tour community.versionone.com/VersionOne_Connect/Developer_Library/… Tbh the documentation is horribly organized, it's structured so wierd...

    – Hassassin
    Mar 24 at 12:33







  • 1





    Could you please provide a valid URL? Also, add a screenshot of the working OK PostMan request with all headers and parameters to the question (or the link).

    – omegastripes
    Mar 24 at 23:45












  • The valid URL for the endpoint will be troublesome to post, since the endpoint is organisation independant and therefore "non-disclosable". However, screenshots of the PostMan request i s possible. I will update this post with it.

    – Hassassin
    Mar 25 at 8:57

















  • No, it's supposed to be a get request. :)

    – Hassassin
    Mar 24 at 10:57











  • Can you point to which example in the guidance aligns with your use case? The closest I found so far is a POST request here: community.versionone.com/VersionOne_Connect/Developer_Library/…

    – QHarr
    Mar 24 at 11:52






  • 1





    Endpoint introduction community.versionone.com/VersionOne_Connect/Developer_Library/… Endpoint tour community.versionone.com/VersionOne_Connect/Developer_Library/… Tbh the documentation is horribly organized, it's structured so wierd...

    – Hassassin
    Mar 24 at 12:33







  • 1





    Could you please provide a valid URL? Also, add a screenshot of the working OK PostMan request with all headers and parameters to the question (or the link).

    – omegastripes
    Mar 24 at 23:45












  • The valid URL for the endpoint will be troublesome to post, since the endpoint is organisation independant and therefore "non-disclosable". However, screenshots of the PostMan request i s possible. I will update this post with it.

    – Hassassin
    Mar 25 at 8:57
















No, it's supposed to be a get request. :)

– Hassassin
Mar 24 at 10:57





No, it's supposed to be a get request. :)

– Hassassin
Mar 24 at 10:57













Can you point to which example in the guidance aligns with your use case? The closest I found so far is a POST request here: community.versionone.com/VersionOne_Connect/Developer_Library/…

– QHarr
Mar 24 at 11:52





Can you point to which example in the guidance aligns with your use case? The closest I found so far is a POST request here: community.versionone.com/VersionOne_Connect/Developer_Library/…

– QHarr
Mar 24 at 11:52




1




1





Endpoint introduction community.versionone.com/VersionOne_Connect/Developer_Library/… Endpoint tour community.versionone.com/VersionOne_Connect/Developer_Library/… Tbh the documentation is horribly organized, it's structured so wierd...

– Hassassin
Mar 24 at 12:33






Endpoint introduction community.versionone.com/VersionOne_Connect/Developer_Library/… Endpoint tour community.versionone.com/VersionOne_Connect/Developer_Library/… Tbh the documentation is horribly organized, it's structured so wierd...

– Hassassin
Mar 24 at 12:33





1




1





Could you please provide a valid URL? Also, add a screenshot of the working OK PostMan request with all headers and parameters to the question (or the link).

– omegastripes
Mar 24 at 23:45






Could you please provide a valid URL? Also, add a screenshot of the working OK PostMan request with all headers and parameters to the question (or the link).

– omegastripes
Mar 24 at 23:45














The valid URL for the endpoint will be troublesome to post, since the endpoint is organisation independant and therefore "non-disclosable". However, screenshots of the PostMan request i s possible. I will update this post with it.

– Hassassin
Mar 25 at 8:57





The valid URL for the endpoint will be troublesome to post, since the endpoint is organisation independant and therefore "non-disclosable". However, screenshots of the PostMan request i s possible. I will update this post with it.

– Hassassin
Mar 25 at 8:57












1 Answer
1






active

oldest

votes


















0














SOLVED Finally...



So i found the answer.
After re-analyzing the Postman response i found that the JSON response was actually handed as a gzip encoded response. Which is simply not compatible with the MSXML2.XMLHTTP lib.



So to solve the problem all I did was to use the WinHttp.WinHttpRequest.5.1 lib instead, which is basicly newer. No other changes to the code was needed.



So to others out there using MSXML2.XMLHTTP or the WinHTTPserver.6.0 lib, change to the newer library :)




Option Explicit
Sub Test_LateBinding()

Dim objRequest As Object
Dim strUrl As String
Dim strResponse As String
Dim body As String
Dim strResponseHeaders As String
Dim allResponseHeader As String

Set objRequest = CreateObject("WinHttp.WinHttpRequest.5.1")
strUrl = "https://endpoint"
body = " ""from"": ""Epic"",""select"": []"
'with basic'
With objRequest
.Open "GET", strUrl, False, "XXXX", "XXXX"
.SetRequestHeader "Content-Type", "application/json"
.Send body
strResponseHeaders = .StatusText
strResponse = .ResponseText
allResponseHeader = .GetAllResponseHeaders
End With
Debug.Print body
Debug.Print allResponseHeader
Debug.Print strResponse

End Sub





share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55322328%2fvba-http-request-to-api-with-json-body-returns-empty-array-msxml2-xmlhttp-in-ex%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    SOLVED Finally...



    So i found the answer.
    After re-analyzing the Postman response i found that the JSON response was actually handed as a gzip encoded response. Which is simply not compatible with the MSXML2.XMLHTTP lib.



    So to solve the problem all I did was to use the WinHttp.WinHttpRequest.5.1 lib instead, which is basicly newer. No other changes to the code was needed.



    So to others out there using MSXML2.XMLHTTP or the WinHTTPserver.6.0 lib, change to the newer library :)




    Option Explicit
    Sub Test_LateBinding()

    Dim objRequest As Object
    Dim strUrl As String
    Dim strResponse As String
    Dim body As String
    Dim strResponseHeaders As String
    Dim allResponseHeader As String

    Set objRequest = CreateObject("WinHttp.WinHttpRequest.5.1")
    strUrl = "https://endpoint"
    body = " ""from"": ""Epic"",""select"": []"
    'with basic'
    With objRequest
    .Open "GET", strUrl, False, "XXXX", "XXXX"
    .SetRequestHeader "Content-Type", "application/json"
    .Send body
    strResponseHeaders = .StatusText
    strResponse = .ResponseText
    allResponseHeader = .GetAllResponseHeaders
    End With
    Debug.Print body
    Debug.Print allResponseHeader
    Debug.Print strResponse

    End Sub





    share|improve this answer



























      0














      SOLVED Finally...



      So i found the answer.
      After re-analyzing the Postman response i found that the JSON response was actually handed as a gzip encoded response. Which is simply not compatible with the MSXML2.XMLHTTP lib.



      So to solve the problem all I did was to use the WinHttp.WinHttpRequest.5.1 lib instead, which is basicly newer. No other changes to the code was needed.



      So to others out there using MSXML2.XMLHTTP or the WinHTTPserver.6.0 lib, change to the newer library :)




      Option Explicit
      Sub Test_LateBinding()

      Dim objRequest As Object
      Dim strUrl As String
      Dim strResponse As String
      Dim body As String
      Dim strResponseHeaders As String
      Dim allResponseHeader As String

      Set objRequest = CreateObject("WinHttp.WinHttpRequest.5.1")
      strUrl = "https://endpoint"
      body = " ""from"": ""Epic"",""select"": []"
      'with basic'
      With objRequest
      .Open "GET", strUrl, False, "XXXX", "XXXX"
      .SetRequestHeader "Content-Type", "application/json"
      .Send body
      strResponseHeaders = .StatusText
      strResponse = .ResponseText
      allResponseHeader = .GetAllResponseHeaders
      End With
      Debug.Print body
      Debug.Print allResponseHeader
      Debug.Print strResponse

      End Sub





      share|improve this answer

























        0












        0








        0







        SOLVED Finally...



        So i found the answer.
        After re-analyzing the Postman response i found that the JSON response was actually handed as a gzip encoded response. Which is simply not compatible with the MSXML2.XMLHTTP lib.



        So to solve the problem all I did was to use the WinHttp.WinHttpRequest.5.1 lib instead, which is basicly newer. No other changes to the code was needed.



        So to others out there using MSXML2.XMLHTTP or the WinHTTPserver.6.0 lib, change to the newer library :)




        Option Explicit
        Sub Test_LateBinding()

        Dim objRequest As Object
        Dim strUrl As String
        Dim strResponse As String
        Dim body As String
        Dim strResponseHeaders As String
        Dim allResponseHeader As String

        Set objRequest = CreateObject("WinHttp.WinHttpRequest.5.1")
        strUrl = "https://endpoint"
        body = " ""from"": ""Epic"",""select"": []"
        'with basic'
        With objRequest
        .Open "GET", strUrl, False, "XXXX", "XXXX"
        .SetRequestHeader "Content-Type", "application/json"
        .Send body
        strResponseHeaders = .StatusText
        strResponse = .ResponseText
        allResponseHeader = .GetAllResponseHeaders
        End With
        Debug.Print body
        Debug.Print allResponseHeader
        Debug.Print strResponse

        End Sub





        share|improve this answer













        SOLVED Finally...



        So i found the answer.
        After re-analyzing the Postman response i found that the JSON response was actually handed as a gzip encoded response. Which is simply not compatible with the MSXML2.XMLHTTP lib.



        So to solve the problem all I did was to use the WinHttp.WinHttpRequest.5.1 lib instead, which is basicly newer. No other changes to the code was needed.



        So to others out there using MSXML2.XMLHTTP or the WinHTTPserver.6.0 lib, change to the newer library :)




        Option Explicit
        Sub Test_LateBinding()

        Dim objRequest As Object
        Dim strUrl As String
        Dim strResponse As String
        Dim body As String
        Dim strResponseHeaders As String
        Dim allResponseHeader As String

        Set objRequest = CreateObject("WinHttp.WinHttpRequest.5.1")
        strUrl = "https://endpoint"
        body = " ""from"": ""Epic"",""select"": []"
        'with basic'
        With objRequest
        .Open "GET", strUrl, False, "XXXX", "XXXX"
        .SetRequestHeader "Content-Type", "application/json"
        .Send body
        strResponseHeaders = .StatusText
        strResponse = .ResponseText
        allResponseHeader = .GetAllResponseHeaders
        End With
        Debug.Print body
        Debug.Print allResponseHeader
        Debug.Print strResponse

        End Sub






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 28 at 14:20









        HassassinHassassin

        62




        62





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55322328%2fvba-http-request-to-api-with-json-body-returns-empty-array-msxml2-xmlhttp-in-ex%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            위키백과:대문 둘러보기 메뉴기부 안내모바일판 대문크리에이티브 커먼즈 저작자표시-동일조건변경허락 3.0CebuanoDeutschEnglishEspañolFrançaisItaliano日本語NederlandsPolskiPortuguêsРусскийSvenskaTiếng ViệtWinaray中文العربيةCatalàفارسیSrpskiУкраїнськаБългарскиНохчийнČeštinaDanskEsperantoEuskaraSuomiעבריתMagyarՀայերենBahasa IndonesiaҚазақшаBaso MinangkabauBahasa MelayuBân-lâm-gúNorskRomânăSrpskohrvatskiSlovenčinaTürkçe

            용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh