200 ok response from power bi rest api but no json

删除回忆录丶 提交于 2019-12-25 01:53:02

问题


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.



来源:https://stackoverflow.com/questions/53669971/200-ok-response-from-power-bi-rest-api-but-no-json

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!