Hi i wrote this code to make an Post Request within my c# application:
{
using (var request = new HttpRequestMessage(new HttpMethod("PATCH"), "https://api.twitch.tv/helix/channels?scope=channel_editor&broadcaster_id=<my_broadcast_id>&scope=bits:read"))
{
request.Headers.TryAddWithoutValidation("Authorization", "Bearer <token>");
request.Headers.TryAddWithoutValidation("Client-Id", "<client_id>");
request.Content = new StringContent("{\"game_id\":\"33214\", \"title\":\"dscs\", \"broadcaster_language\":\"en\"}");
request.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json");
var response = await httpClient.SendAsync(request);
Console.WriteLine(response.ToString());
}
}
This is the corresponding CURL Command:
curl -X PATCH ‘https://api.twitch.tv/helix/channels?scope=channel_editor&broadcaster_id=76126553&scope=bits:read’
-H 'Authorization: Bearer ’
-H ‘Client-Id: <client_id>’
-H ‘Content-Type: application/json’
–data-raw ‘{“game_id”:“33214”, “title”:“twitch api test”, “broadcaster_language”:“en”}’
I receive no error but the stream settings arent changed. Can anybody help me on this ?