title: hitbox.tv api can't update_live_media
body: <p>Currently I doing a project by using hitbox.tv api plug in to my website. I would like to update my video title during when I'm broadcasting live stream. I using guzzle 6 to send http request to api end point, the following is my code</p>
  
  <p>myGuzzle.php</p>
  
  <pre><code>&lt;?php
  namespace myGuzzle;
  
  require __DIR__.'/../vendor/autoload.php';
  use GuzzleHttp\Client;
  use GuzzleHttp\Exception\ClientException;
  
  class myGuzzle{
  
  
      public $params;
      public $method;
      public $endpoint;
      public $body;
      public $status;
      public $errorJson;
  
  
      function response($params=[],$method,$endpoint) {
  
          $this-&gt;params = $params;
          $this-&gt;method = $method;
          $this-&gt;endpoint = $endpoint;
               $client = new Client();
               try{
  
              $response = $client-&gt;request($this-&gt;method, $this-&gt;endpoint,['json' =&gt; $this-&gt;params]);
  
               $this-&gt;body = $response-&gt;getBody();
               $this-&gt;status = $response-&gt;getStatusCode();
  
               }
  
               catch(ClientException $e){
  
  
               $this-&gt;body = $e-&gt;getMessage();
               $this-&gt;status = $e-&gt;getCode();
               $this-&gt;errorJson = $e-&gt;getResponse()-&gt;getBody();
                  }
  
  
      }
  
  
  
       function getStatus(){
  
           return $this-&gt;status;
       }   
       function getBody(){
           return $this-&gt;body;
  
       }
       function getErrorJson(){
  
           return $this-&gt;errorJson;
       }
  }
  </code></pre>
  
  <p>updateLiveMedia.php
      
  
  <pre><code>namespace models;
  
  use myGuzzle\myGuzzle;
  
  class updateLiveMedia {
      protected $username;
      protected $access_token;
      public $media_user_name;
      public $media_id;
      public $media_category_id;
      public $media_live_delay;
      public $media_hidden;
      public $media_recording;
      public $media_mature;
      public $media_hosted_name;
      public $media_countries = [];
      public $media_status;
      public $media_description;
  
  
  
      function __construct($username,$acessToken) {
  
          $this-&gt;username = $username;
          $this-&gt;access_token = $acessToken;
          $this-&gt;media_countries = ["EN"];
          $this-&gt;media_category_id = '0';
          $this-&gt;media_recording = "1";
          $this-&gt;media_mature ='0';
          $this-&gt;media_user_name = $this-&gt;username;
          $this-&gt;media_hosted_name = "on";
          $this-&gt;media_live_delay='2';
          $this-&gt;media_hidden = '0';
      }
  
      /*
       * Parameters function(title,descritption) or
       * Parameters function(title,description,countries).
       */
  
      function update($opts=[]){
  
          if(is_array($opts)){
  
              foreach($opts as $key=&gt;$value){
  
                  $this-&gt;$key = $value;
              }
  
          }
          $myGuzzle = new myGuzzle;
  
          $uri = "https://api.hitbox.tv/media/live/".$this-&gt;username."?authToken=".$this-&gt;access_token;
          $params = ["livestream"=&gt;[
      [
        "media_user_name"=&gt;$this-&gt;username,
        "media_id"=&gt;$this-&gt;media_id,
        "media_category_id"=&gt;$this-&gt;media_category_id,
        "media_live_delay"=&gt;$this-&gt;media_live_delay,
        "media_hidden"=&gt;$this-&gt;media_hidden,
        "media_recording"=&gt;$this-&gt;media_recording,
        "media_mature"=&gt;$this-&gt;media_mature,
        "media_hosted_name"=&gt;$this-&gt;media_hosted_name,
        "media_countries"=&gt;  $this-&gt;media_countries,
        "media_status"=&gt;$this-&gt;media_status,
        "media_description"=&gt;$this-&gt;media_description,
      ]
    ]];
         $myGuzzle-&gt;response($params,"PUT",$uri);
         return $myGuzzle-&gt;getBody();
         if($myGuzzle-&gt;getStatus() == 200){
             return true;
         }
          return false;
  
          } 
  
          }
  </code></pre>
  
  <p>run update() return the following result </p>
  
  <pre><code>{"success":true,"error":false,"message":"host_mode_enabled"}
  </code></pre>
  
  <p>According the documentation provided by hitbox.tv (<a href="http://developers.hitbox.tv/#update-live-media" rel="nofollow">http://developers.hitbox.tv/#update-live-media</a>) should return something like the following</p>
  
  <pre><code>{
    "livestream": [
      {
        "media_user_name": "masta",
        "media_id": "1",
        "media_category_id": "447",
        "media_live_delay": "0",
        "media_hidden": "0",
        "media_recording": "1",
        "media_mature": "0",
        "media_countries": [
          "EN"
        ],
        "media_status": "This is a stream title!",
        "media_description_md": null
      }
    ]
  }
  </code></pre>