public function ServicesContentTypeNegotiator::getResponseFormatFromURL in Services 7.3
Retrieve formatter from URL. If format is in the path, we remove it from $canonical_path.
For example <endpoint>/<path>.<format>
Parameters
$canonical_path:
Return value
string
Overrides ServicesContentTypeNegotiatorInterface::getResponseFormatFromURL
File
- servers/
rest_server/ includes/ ServicesContentTypeNegotiator.inc, line 23
Class
- ServicesContentTypeNegotiator
- Class used to do Content Type negotiation.
Code
public function getResponseFormatFromURL($canonical_path) {
$matches = $this
->getCanonicalPathMatches($canonical_path);
return $matches[2];
}