I'm using the Xml/Json views for an API.
Going to '/Api.json' or '/Api.xml' works fine, but I'd like it to default to the XmlView when posting to '/Api'
What's the most simple/best way get this done?
The real trick was this one liner, had to look at the api documentation and try a couple of things:
public function beforeRender() {
if(empty($this->RequestHandler->request->params['ext'])) {
$this->RequestHandler->renderAs($this, 'xml');
}
}