如果我尝试更改twitch.tv状态或游戏标题,请获取401错误(Get 401 Error if i try to change twitch.tv status or game title)
我得到了隐含授权流和范围channel_editor的oauth令牌。 如果我尝试更改频道标题,则来自抽搐服务器的答案是401令牌无效或缺少必需的范围。
这是我试图改变频道状态的代码:
var client = new RestClient("https://api.twitch.tv/kraken/channels/innoszorn83"); var request = new RestRequest(Method.PUT); request.AddHeader("cache-control", "no-cache"); request.AddHeader("content-type", "application/json"); request.AddHeader("authorization", "OAuth " + cs_globals.oauth); request.AddHeader("accept", "application/vnd.twitchtv.v3+json"); request.AddParameter("application/json", "{\"channel\":{\"status\":\"Hello World\"}}", ParameterType.RequestBody); IRestResponse response = client.Execute(request);我在c#programm中获得了关于webbrowser控件的oauth。
I get an oauth token with the Implicit Grant Flow and the scope channel_editor. If I try to change the the channel title the answer from twitch server is 401 Token invalid or missing required scope.
Thats the code i try to change the channel status:
var client = new RestClient("https://api.twitch.tv/kraken/channels/innoszorn83"); var request = new RestRequest(Method.PUT); request.AddHeader("cache-control", "no-cache"); request.AddHeader("content-type", "application/json"); request.AddHeader("authorization", "OAuth " + cs_globals.oauth); request.AddHeader("accept", "application/vnd.twitchtv.v3+json"); request.AddParameter("application/json", "{\"channel\":{\"status\":\"Hello World\"}}", ParameterType.RequestBody); IRestResponse response = client.Execute(request);I get the oauth about a webbrowser control in my c# programm.
最满意答案
我找到了解决方案。 我的代码中有一个错误。 我没有将范围更改为channel_editor
I found the solution. I have one error in my code. I doesn't change the scope to channel_editor
更多推荐
发布评论