title: HTML response support for Restler 3 APIs
body: <p>I need to support different response formats like JSON and HTML, so far this was good with JSON response formats, now I tried to support HTML response from my APIs and facing issues.</p>
  
  <p>I need to return JSON response from some of the APIs and HTML response from some APIs, but all the APIs(methods) present in same class.</p>
  
  <p>If I add both JSON and HTML in supported formats list then all APIs are returning HTML response only, not sure how to manage this situation.</p>
  
  <p><code>
  $r->setSupportedFormats('JsonFormat', 'HtmlFormat');
  </code></p>
  
  <p>This is the code block I am using to set JSON and HTML in supported formats list, anybody please let me know how to handle this scenario.</p>
  
  <p><strong>index.php</strong></p>
  
  <pre>
  use Luracast\Restler\Defaults;  
  use Luracast\Restler\Filter\RateLimit;  
  use Luracast\Restler\Format\UploadFormat;  
  use Luracast\Restler\Format\HtmlFormat;  
  use Luracast\Restler\Restler;  
  
  require_once 'vendor/restler.php';  
  require_once('config.php');    
  
  Defaults::$throttle = 20;  
  Defaults::$cacheDirectory = PLAY_API_CACHE_DIR;
  
  // Setup restler  
  $r = new Restler();  
  $r->addAPIClass('test');  
  $r->addAPIClass('Resources');   
  $r->addFilterClass('RateLimit');  
  $r->setSupportedFormats('JsonFormat', 'UploadFormat', 'HtmlFormat');  
  $r->handle();  
  </pre>
  
  <p><strong>test.php</strong></p>
  
  <pre>
  require_once 'BaseHandler.php';
  
  class test extends BaseHandler {
  
      // Initialize API class attributes
      public function __construct() {
          parent::__construct();
      }
  
      /**
      * Request the breakdown,by category, of a user's synced data.
      * 
      * @param string $auth_token SSO Authentication Token
      *
      * @url GET getStorageUsage
      */
      public function getStorageUsage($auth_token = '') {
  
          // Required parameters checkup
          if (!$auth_token && isset($_SESSION['play_auth_token'])) $auth_token = $_SESSION['play_auth_token'];
          if (!$auth_token  )    return PlayErrorCodes::throwParameterMissingError();
  
          // Get a breakdown,by category, of a user's synced data using Sync API call
          return $this->callAPI('sync', 'getStorageUsage', array('auth_token' => $auth_token));    
      }
  
      /**
      * Requests the full HTML document representing a users data graphically
      * 
      * @param string $auth_token SSO Authentication Token
      * @param string $client Name of the client requesting the widget.  android is the only acceptable and default value.
      * @param string $path Path of the resource to display.  Defaults to '/'
      *
      * @url GET getWidget
      * @view getWidgetView
      */
      public function getWidget($auth_token = '',$client = '',$path = '') {
          // Required parameters checkup
          if (!$auth_token && isset($_SESSION['play_auth_token'])) $auth_token = $_SESSION['play_auth_token'];
          if (!$auth_token)    return PlayErrorCodes::throwParameterMissingError();
  
          // Get the full HTML document representing a users data graphically using Sync API call
          $this->resDecodeFlag = false;
          return $this->callAPI('sync', 'getWidget', array('auth_token' => $auth_token, 'client' => $client, 'path' => $path)); 
      }
  
  }
  </pre>
  
  <p>Here I need to return JSON response for 'getStorageUsage' and HTML response for 'getWidget'.</p>
  
  <p>References I have gone through are:<br>
  <a href="http://restler3.luracast.com/examples/_013_html/readme.html" rel="nofollow">http://restler3.luracast.com/examples/_013_html/readme.html</a><br>
  <a href="https://github.com/Luracast/Restler/tree/master/public/examples/_013_html#html-format" rel="nofollow">https://github.com/Luracast/Restler/tree/master/public/examples/_013_html#html-format</a></p>
  
  <p>Thanks in advance... Siva.</p>