locked
Swagger Rest API Call RRS feed

Answers

  • User-893002196 posted

    Hi,

    I found the solution. My mistake. I can call using JavaScript function as below:-

    function callGetxxxxxx() {

               var req = new XMLHttpRequest();

               req.open("GET", 'https://xxxx.azurewebsites.net/api/xxxxxxxxxxxx', true);

               req.setRequestHeader('Content-Type', 'application/json; charset=utf-8');

               req.setRequestHeader('Accept', 'application/json');

               req.setRequestHeader("Authorization", "Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");

               //req.send();

     

               req.onreadystatechange = function () {//Call a function when the state changes.

                   if (req.readyState == 4 && req.status == 200) {

                       alert(req.responseText);

                   }

               }

               req.send();

     

    }

    Thanks.

    Regards,

    Micheale

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, October 22, 2019 3:39 PM