43 $selectedContentTypes = array_intersect(explode(
',', $acceptHeader), $this->knownContentTypes);
45 if (count($selectedContentTypes)) {
46 return current($selectedContentTypes);
50 if (preg_match(
'/\+(json|xml)/', $acceptHeader, $matches)) {
51 $mediaType =
'application/' . $matches[1];
52 if (in_array($mediaType, $this->knownContentTypes)) {
Representation of an incoming, server-side HTTP request.
foreach($paths as $path) $request
determineContentType(ServerRequestInterface $request)
Determine which content type we know about is wanted using Accept header.
Slim Framework (https://slimframework.com)
getHeaderLine($name)
Retrieves a comma-separated string of the values for a single header.
Abstract Slim application handler.