code: private function _selectAcceptHeader($accept)
      {
          if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) {
              return null;
          } elseif (preg_grep("/application\/json/i", $accept)) {
              return 'application/json';
          } else {
              return implode(',', $accept);
          }
      }
docs: /*
  Return the header 'Accept' based on an array of Accept provided
  
  @param string[] $accept Array of header
  
  @return string Accept (e.g. application/json)