如果我尝试更改twitch.tv状态或游戏标题,请获取401错误(Get 401 Error if i try to change twitch.tv status or game title)

编程入门 行业动态 更新时间:2024-10-28 14:35:35
如果我尝试更改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

更多推荐

本文发布于:2023-07-22 02:57:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1216284.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:状态   错误   标题   游戏   twitch

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!