我获得了Implicit Grant Flow和范围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。