Opened 9 years ago

Closed 8 years ago

#11928 closed enhancement (fixed)

ItemFileReadStore Should Allow Custom HTTP Headers to Integration Better with MVC Frameworks

Reported by: josh.harness@… Owned by: Jared Jurkiewicz
Priority: high Milestone: 1.8
Component: Data Version: 1.5
Keywords: Cc: josh.harness@…
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 9 years ago by Jared Jurkiewicz

Milestone: tbd1.7

comment:2 Changed 8 years ago by Chris Mitchell

Milestone: 1.71.8

comment:3 Changed 8 years ago by Jared Jurkiewicz

In [27221]:

Added in support for setting custom headers \!strict refs #11928

comment:4 Changed 8 years ago by Jared Jurkiewicz

In [27222]:

Added in support for setting custom headers \!strict refs #11928

comment:5 Changed 8 years ago by Jared Jurkiewicz

In [27223]:

Added in support for setting custom headers \!strict refs #11928

comment:6 Changed 8 years ago by Jared Jurkiewicz

In [27224]:

Added in support for setting custom headers \!strict refs #11928

comment:7 Changed 8 years ago by Jared Jurkiewicz

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.