I'm experimenting with the simply lift example rest app:
with the latest lift 2.3-SNAPSHOT.
The Accept header detection overrides the url extension
returns json as expected, but:
also returns json. This appears to be because curl sends by default an
curl -H "Accept:" http://localhost:8080/simple3/item/1234.xml
to stop curl sending an Accept header.
Experience with our api (http://content.guardianapis.com) is that developers always get the extension right, but are not so good at getting Accept headers right... And I always test an api with curl
before writing any code, I guess other people do too, so the curl use case is particularly confusing.
[The background: content.guardianapis.com is implemented in scala with Guice and plain servlets. I'm considering moving the code to use RestHelper.]
Is it possible to make the extension, if provided and valid, always override the accept headers?
Imported from Assembla: http://www.assembla.com/spaces/liftweb/tickets/942
Fixes #942. json and xml requests do not match */* as documented