我想對這個API的請求:訪問JSON API,自定義接受類型瘋狂
http://services.vrt.be/epg/playlists
默認情況下它返回的text/html。
當我在這樣的瀏覽器中查詢它: http://services.vrt.be/epg/playlists?accept=text/html它仍然返回所需的HTML。
但是,當我查詢它是這樣的: http://services.vrt.be/epg/playlists?accept=application/vnd.epg.vrt.be.playlists_1.0+json
有了正確的數據類型在API文檔它406的爲說明,並告訴我這是不能接受的。
錯誤頁面這樣表示接受類型的列表:
以下介質類型支持:應用程序/ vnd.epg.vrt.be.playlists_1.0 + XML,應用/ vnd.epg .vrt.be.playlists_1.0 + json,application/vnd.epg.vrt.be.playlists_1.1 + xml,application/vnd.epg.vrt.be.playlists_1.1 + json,text/html
我們列出了我提供的accepttype。我做錯了什麼,我是否正確傳遞? (accept參數是由文檔定義和作品第i個文本/ HTML類型時提供)
感謝