Feature #315
Add "format" support to the Request object
Status: | Resolved | Start date: | 2008-02-15 | |
---|---|---|---|---|
Priority: | Must have | Due date: | ||
Assigned To: | Robert Lemke | % Done: | 100% |
|
Category: | MVC | |||
Target version: | TYPO3 Flow Base Distribution - 1.0 alpha 11 | |||
PHP Version: | Complexity: | |||
Has patch: |
Description
The Request object (mainly WebRequest) should contain information about the requested format. Currently it only provides a controller and an action name.
The default format would be "html" for web requests and "text" for CLI requests.
The router which extracts information for building a web request could determine the requested format from two sources:
- the file extension (.html, .txt, .pdf, .js, .json, .atom, .rss, .xml etc.)
- the HTTP headers (content negotiation) - this is mainly for AJAX requests
See also:
http://www.iana.org/assignments/media-types/
http://en.wikipedia.org/wiki/Content_negotiation
Related issues
History
#1 Updated by Robert Lemke about 7 years ago
- Target version deleted (
18)
#2 Updated by Robert Lemke almost 7 years ago
- % Done changed from 0 to 50
This was mainly addressed by r1077 (added support for format).
What's still missing is the analysis of the HTTP headers / the content negotiation.
#3 Updated by Karsten Dambekalns almost 7 years ago
- Priority changed from Should have to Must have
- Target version set to 1.0 alpha 1
#4 Updated by Robert Lemke about 6 years ago
- Target version changed from 1.0 alpha 1 to 283
#5 Updated by Robert Lemke about 6 years ago
- Target version deleted (
283)
#6 Updated by Robert Lemke almost 5 years ago
- Target version set to 1.0 alpha 11
#7 Updated by Robert Lemke almost 5 years ago
- Status changed from Accepted to Resolved
- % Done changed from 50 to 100
Okay, as it seems the Accept header is not used consistently and correctly among different browser (see http://www.gethifi.com/blog/browser-rest-http-accept-headers) and that even if it was, there are a number of reasons why multiple URLs for different formats is the better design choice (see also http://www.artima.com/weblogs/viewpost.jsp?thread=192218).
Therefore I drop the idea of built-in content negotiation, at least for now.