PUT method json body channel status

`$.ajax({
        url: 'https://api.twitch.tv/kraken/channels/'+twitchUserID+'?client_id='+ twitchClientId,
        type: 'PUT',
        contentType: 'application/x-www-form-urlencoded',
        headers: {
       		'Accept' : 'application/vnd.twitchtv.v5+json',
			'Authorization':'OAuth OAuth_Token'
       	},
       	data: {"channel": {"status": userTitle, "game": userGame}},
    	success: function(data) {
         	// console.log(data.status);
         	// console.log(data);
         	alert("Status and Game Updated");

    	}
	});`

Whats the problem?

You’ve just posted an ajax example?!

You specify the content type of your body as x-www-form-urlencoded but send a json body instead.

yes but somehow this is the only way i was able to get the status updated with json instead of urlencoded which is not %20 friendly nor does it like #

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.