Opened 12 years ago
Closed 11 years ago
#11928 closed enhancement (fixed)
ItemFileReadStore Should Allow Custom HTTP Headers to Integration Better with MVC Frameworks
Reported by: | Owned by: | Jared Jurkiewicz | |
---|---|---|---|
Priority: | high | Milestone: | 1.8 |
Component: | Data | Version: | 1.5 |
Keywords: | Cc: | [email protected]… | |
Blocked By: | Blocking: |
Description
One common implementation pattern with Spring MVC is to allow the view to be selected by inspecting the HTTP headers sent by the client. For instance, if the client submits an accept header of "application/json", Spring MVC can resolve the response to be a json view. Similarly, if the application submits an accept header of "text/html", then an html view can be chosen.
When using the ItemFileReadStore? with the url attribute, it submits a default accept header as follows:
"text/html,application/xhtml+xml,application/xml;"
Since this doesn't appear to be customizable, one cannot adjust the header to send the "application/json" header - which is most often when you want when using the ItemFileReadStore?.
While you can work around this on the server-side, it would be nice not to have to. I think the following enhancements should be considered for implementation:
- This store and any other similar ones ought to send the "application/json" header by default since this format is the most common and the store expects json to be returned.
- The HTTP headers sent should be customizable by the caller to handle any other situations similar to this one.
Change History (7)
comment:1 Changed 11 years ago by
Milestone: | tbd → 1.7 |
---|
comment:2 Changed 11 years ago by
Milestone: | 1.7 → 1.8 |
---|
comment:3 Changed 11 years ago by
comment:7 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
In [27221]: