code: protected function getFormatFromUri($requestedUri)
      {
          $uriParts = explode('?', $requestedUri, 2);
          $uriWithoutGet = reset($uriParts);
          $uriAndFormat = explode('.', $uriWithoutGet);
          if (count($uriAndFormat) >= 2) {
              return end($uriAndFormat);
          }
          return null;
      }
docs: Get the format from the url.
  
  If the request had a suffix in the url, this method will discover it and
  return it.
  
  @example /hello-world.json => json
  @example /hello-world.xml => xml
  @example /hello-world => null
  
  @param $requestedUri
  @return string|null