# Cant PUT stream STATUS via JS/AJAX (selfSolved)

**URL:** <https://discuss.dev.twitch.com/t/cant-put-stream-status-via-js-ajax-selfsolved/379>\
**Category:** API\
**Created:** [January 21, 2014, 3:34pm UTC](https://discuss.dev.twitch.com/t/cant-put-stream-status-via-js-ajax-selfsolved/379 "2014-01-21T15:34:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lebannehn](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/lebannehn/32/209_2.png) [@lebannehn](https://discuss.dev.twitch.com/u/lebannehn)\
**Post date:** [January 21, 2014, 3:34pm UTC](https://discuss.dev.twitch.com/t/cant-put-stream-status-via-js-ajax-selfsolved/379/1 "2014-01-21T15:34:19Z")

</div>

Good day. Im trying to change my channel title by using this code:

```
jsontext = JSON.stringify(['channel', {'status': 'MY TITLE'}]);
    $.ajax({
        url: 'https://api.twitch.tv/kraken/channels/mychannel',
        type: 'PUT',
        headers: {
            Accept: "application/vnd.twitchtv.v2+json",
            Authorization: "OAuth "+token
        },
        dataType: "json",
        contentType: "application/json",
        data: jsontext,
        success: function(data) {
          console.log(data.status);
        }
   });

```

but nothing changes and here what console tells me:

```
No 'Access-Control-Allow-Origin' header is present on the requested resource.

```

However when i use Chrome app named POSTMAN to test my url it works perfectly.

Did I forget something in my code?

---

<div class="post-metadata">

**Author:** ![lebannehn](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/lebannehn/32/209_2.png) [@lebannehn](https://discuss.dev.twitch.com/u/lebannehn)\
**Post date:** [January 22, 2014, 5:18pm UTC](https://discuss.dev.twitch.com/t/cant-put-stream-status-via-js-ajax-selfsolved/379/2 "2014-01-22T17:18:06Z")

</div>

Thanks to developers for undocumented feature ‘&\_method=put’ ):

```
$.ajax({
            url: 'https://api.twitch.tv/kraken/channels/mychannel?channel[status]='+titleStr+'&oauth_token=' +token+'&_method=put',
            type: 'GET',
            contentType: 'application/json',
            dataType: 'jsonp',
            success: function(data) {
              console.log(data.status);
            }
});   

```

This code works now.
