My Old codes this:
string result;
using (HttpRequest httpRequest = new HttpRequest())
{
try
{
httpRequest.UserAgent = Http.RandomUserAgent();
httpRequest.Referer = “Twitch;
httpRequest.IgnoreProtocolErrors = true;
httpRequest.Reconnect = false;
httpRequest.Authorization = “OAuth " + token;
httpRequest.AddHeader(“Pragma”, “no-cache”);
httpRequest.AddHeader(“Origin”, “https://twitch.tv”);
httpRequest.AddHeader(“Client-Id”, “xxxxxxxxxxxxx”);
bool flag = this.follow;
string str;
if (flag)
{
str = “[{“operationName”:“name_FollowUser”,“variables”:{“input”:{“disableNotifications”:false,“targetID”:”” + this.followChannelId + “”}},“extensions”:{“persistedQuery”:{“version”:1,“sha256Hash”:“51956xxxxxxxxxxxxxxxxd4b62096a1ac03be9e6”}}}]“;
}
else
{
str = “[{“operationName”:“name_UnfollowUser”,“variables”:{“input”:{“targetID”:”” + this.followChannelId + “”}},“extensions”:{“persistedQuery”:{“version”:1,“sha256Hash”:“d7fbdxxxxxxxxxxxxxxxxxxxxxxea1c52bb632d41”}}}]";
}
result = httpRequest.Post(“https://gql.twitch.tv/gql”, str, “text/plain;charset=UTF-8”).ToString();
}
catch (Exception)
{
result = “request error”;
}
}
return result;
What is the new api codes? Somebody help me please. Best,