Hello,

One simple hack I use is to check for ajax requests using to the
X-Requested-With
header.
That way I don't add for example the json representation.

Hope it helps,
Rémi

On Wed, Dec 16, 2009 at 05:21, Andrzej Berico <
andy.glo...@bericotechnologies.com> wrote:

> Our Restlet resource server APPLICATION_JSON and APPLICATION_XML. A JQuery
> client, sets the Accept Type to "*/*, application/xml". So the Restlet
> negotiates that APPLICATION_JSON should be returned as expected. However,
> we
> want APPLICATION_XML to be served. The problem is that we are unable to
> remove the "*/*" as the first Accept type in JQuery. JQuery seems to tack
> on
> the "*/*" as an Accept Type to every request we send.
>
> Is there an elegant way in Restlet to filter the "*/*" values, e.g. ALL or
> APPLICATION_ALL? We can certainly get the Accept Headers in Restlet and
> re-arrange the Accept list ourselves to "override" the Restlet negotiation.
> We are thinking of filtering, after Restlet negotiation, based on the
> User-Agent header for this particular JQuery client, so as not to "break"
> the Restlet behaviour for other clients (which is what we expect.)
> --
> View this message in context:
> http://n2.nabble.com/MIME-Accept-Type-filter-tp4173789p4173789.html
> Sent from the Restlet Discuss mailing list archive at Nabble.com.
>
> ------------------------------------------------------
>
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2430710
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2430731

Reply via email to