Skip Menu |

This queue is for tickets about the Catalyst-Action-REST CPAN distribution.

Report information
The Basics
Id: 46974
Status: open
Priority: 0/
Queue: Catalyst-Action-REST

People
Owner: Nobody in particular
Requestors: ddascalescu+perl [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.71
Fixed in: (no value)



Subject: 'Accept' header should have priority for the deserialization format vs. 'Content-Type'
Conversation in #catalyst: dandv: I'm expecting the response serialization to be based on the Accept header, then lacking that, to fall back on the Content-Type header. For example, a client could send a JSON request but expect a text/plain response. I know C::C::REST doesn't work that way, but is this assumption flawed? confound: Accept should be primary for response serialization and Content-Type for request deserialization, but right now Content-Type rules in both directions
From: icestar [...] inbox.ru
On Mon Jun 15 19:05:48 2009, dandv wrote: Show quoted text
> Conversation in #catalyst: > > dandv: I'm expecting the response serialization to be based on the > Accept header, then lacking that, to fall back on the Content-Type > header. For example, a client could send a JSON request but expect a > text/plain response. I know C::C::REST doesn't work that way, but is > this assumption flawed? > > confound: Accept should be primary for response serialization and > Content-Type for request deserialization, but right now Content-Type > rules in both directions
I've found the same omission and agree with previous post. Sometimes it's useful to obtain data in one format and return in another.
From: Gerv
The bug is in Catalyst/TraitFor/Request: # First, we use the content type in the HTTP Request. It wins all. $types{ $self->content_type } = 3 if $self->content_type; The 3 needs to be a 0 or a -1 (and the comment changed). That would give this type a q value lower than a URL parameter or the Accept header. Gerv
I'd love someone to work up some failing tests and a patch to fix them for this issue, and I'd happily apply it. However I don't have time to work on this issue myself at the moment :(
Just hit the same problem, subscribing in case someone fixes it.