Feature #315

Add "format" support to the Request object

Added by Robert Lemke over 11 years ago. Updated almost 9 years ago.

Status:
Resolved
Priority:
Must have
Assignee:
Category:
MVC
Start date:
2008-02-15
Due date:
% Done:

100%

PHP Version:
Has patch:
Complexity:

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

Related to TYPO3.Flow - Feature #10680: Implement Content Negotiation Support Resolved 2010-11-08

History

#1 Updated by Robert Lemke about 11 years ago

  • Target version deleted (18)

#2 Updated by Robert Lemke about 11 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 11 years ago

  • Priority changed from Should have to Must have
  • Target version set to 1.0 alpha 1

#4 Updated by Robert Lemke over 10 years ago

  • Target version changed from 1.0 alpha 1 to 283

#5 Updated by Robert Lemke about 10 years ago

  • Target version deleted (283)

#6 Updated by Robert Lemke about 9 years ago

  • Target version set to 1.0 alpha 11

#7 Updated by Robert Lemke about 9 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.

Also available in: Atom PDF