我試圖創建一個java工具來更改Twitch頻道信息(狀態/遊戲/延遲)。在Documentation就是一個例子,捲曲與API的合作,以更新頻道信息:Java HttpsURLConnection - TwitchAPI - 更新頻道信息
curl -H 'Accept: application/vnd.twitchtv.v3+json' -H 'Authorization: OAuth <access_token>' \
-d "channel[status]=Playing+cool+new+game!&channel[game]=Diablo&channel[delay]=0" \
-X PUT https://api.twitch.tv/kraken/channels/test_channel
我試着用HttpsURLConnection的重新創建此Java編寫的。但是我得到了錯誤響應代碼400,我不知道我的源代碼有什麼問題。
的迴應:{"error":"Bad Request","message":"Missing required parameter channel","status":400}
我的源代碼:http://pastebin.com/F1QyCULu
我希望有人能幫助我解決這個問題。