来自Power Bi Rest API的200 ok响应但没有json [英] 200 ok response from power bi rest api but no json

查看:107
本文介绍了来自Power Bi Rest API的200 ok响应但没有json的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用adal.js调用power bi rest api。令牌可以正常工作以进行授权,响应也可以达到200 ok,但没有结果。这是我正在使用的代码以及尝试访问的URL:

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}

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?

推荐答案

这些是此特定API的已知问题。尝试传递Accept null。

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

这篇关于来自Power Bi Rest API的200 ok响应但没有json的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆