0

嗨,我正在调用 API,它正在返回

[{"ActorID":1,"ActorName":"dfdsf","ActorOccupation":0,"ActorLevel":3,"VsRank":10,"PVP_Vs":0,"FightTotalCount":"0","WinCount":"0"},
{"ActorID":2,"ActorName":"sdsf","ActorOccupation":0,"ActorLevel":0,"VsRank":10,"PVP_Vs":0,"FightTotalCount":"0","WinCount":"0"}]


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html 
        xmlns="http://www.w3.org/1999/xhtml">
        <head>
            <title></title>
        </head>
        <body>
            <form method="post" action="GetRankingList.aspx?pvptype=1&amp;sid=1&amp;tm=20130821160000&amp;auth=77c9b582c3aed3d3974400cfb118fe4b" id="form1">
                <div class="aspNetHidden">
                    <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTE2MTY2ODcyMjlkZLSAAAtd4/lj1u6b0GjPWM+p3i9tqI6sq+xDrRw2cAv3" />
                </div>
                <div></div>
            </form>
        </body>
    </html>

我想要的只是简单的 JSON 数组对象。我没有编写这个 API,但有人知道我怎么可能只指定我想要对象本身。我已经指定

format : "json"

作为我拨打此电话时的参数。无论我如何进行调用(Ajax、浏览器等),都会返回该值。

4

1 回答 1

0

另一个(复杂的)解决方案是通过这个 HTML Sanitizer API 运行它 -

https://www.mashape.com/pbkwee/html-sanitizer#!endpoint-HTML-Sanitizer

我在上面运行了你的输出,它几乎删除了所有内容,除了它在两端填充了 div 标签(你可以删除它们)

于 2013-08-23T17:37:22.423 回答