Mark Ramm wrote:
> My plan is to remove the rule-dispatch portion of the API and replace
> it with something simpler. Basically I'd like to have two main ways
> to declare what content type you want returned from an HTTP request to
> a tg controller:
>
> 1) add the proper accept header to the HTTP Post request. ("text/JSON")
> 2) use a file extension at the end of a URL to declare what you want
> (http://../user.json)
>
> Then we'll just match up a request to the proper content type, and if
> @expose registers a template/engine that matches that content type and
> return it.
The only new thing here is number 2, right? I think that's great. Since
some browsers use the file extension to interpret the content type, and
since it is handy if you want to save a web page, it's usually a good
idea to add the proper extension anyway.
One question is, how can the controller method know which content type
was requested in case more than one format was @exposed? (I understand
that usually it does not need to know, but in some cases it still may be
useful.)
-- Christoph
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---