jQuery AJAX PUT request not updating Twitch stream title despite success response

Hello everyone. I’m having trouble updating my Twitch stream title using jQuery AJAX. The weird thing is that my code seems to work but the title doesn’t actually change.

Here’s what I’m using:

var newTitle = "Streaming awesome gameplay today!";

$.ajax({
    url: 'https://api.twitch.tv/kraken/channels/mystream?channel[status]=' + newTitle + '&oauth_token=' + authToken,
    method: 'PUT',
    dataType: 'jsonp',
    contentType: 'application/json',
    success: function(response) {
        console.log(response.status);
    }
});

The strange part is that I get a success response with the current title, but when I check my channel the title remains unchanged. When I test the exact same URL using Postman it works perfectly and updates the title right away.

Anyone know why this might be happening with jQuery but not with Postman? I’m stumped.

yea, for sure.. the JSONP is messing things up. it’s meant for GET requests, not PUT. you should use regular AJAX with proper CORS headers or even fetch(). also, make sure your auth token has the necessary scopes for modifying your channel.

It seems you’re encountering a common issue with jQuery AJAX calls using JSONP. JSONP is primarily designed for GET requests, which may cause your PUT request to be treated as a GET internally. Consider using a standard JSON request instead, ensuring you properly configure CORS by setting the right headers. Moreover, check that the necessary parameters are sent in the request body; the Twitch API typically requires channel updates to be included in the payload, not in the query string.