200 ok response from power bi rest api but no json

2019-08-21 09:26发布

问题:

I am trying to call power bi rest api using adal.js. Token is working fine for authorization, response also coming 200 ok but no result is showing. Here is my code I am using and the url trying to access:

https://api.powerbi.com/v1.0/myorg/groups/{groupid}/reports/{reportid}

var headers = new Headers();
    var bearer = "Bearer " + token;
    headers.append("Authorization", bearer);
    headers.append("Content-Type", "application/json");
    headers.append("Accept", "None");
    var options = {
        method: "GET",
        headers: headers
    };

    fetch(endPoint, options)
        .then(function (response) {
            d.resolve(response);
        }).catch(function(err) {
            d.reject(err);
        });

what I am doing wrong in my code? Please suggest what should be adding in header?

回答1:

These is a known issue with this specific API. Try passing Accept null.