Is "api" a controller or function? Either way, you can prevent html
requests by (a) making sure there is no .html view file associated with the
particular function and (b) making sure you don't enable the generic.html
view for that controller/function. For example, somewhere in the controller
or function:
response.generic_patterns = ['xml', 'json']
Also, are you hoping to default to an xml response without having to add
the .xml extension to the urls? In that case, somewhere in the controller
or function, you could do:
if request.extension not in ['xml', 'json']:
response.view = '%s/%s.xml' % (request.controller, request.function)
request.extension = 'xml' # only needed if you have enabled generic.xml
Anthony
On Friday, May 25, 2012 6:55:17 PM UTC-4, bob wrote:
>
> Probably a simple question and I searched both the docs and the group.
>
> I have a path /api and I never want to return a html reply, I'm ok with
> a .xml or .json reply and would like to have the default be .xml
>
> The big issue is that I want other urls (i.e. /default/) to return html
> as the default.
>
> thanks,
> bob
>