Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django-piston ignores "Accept" header #3

Open
thurloat opened this issue Feb 10, 2012 · 0 comments
Open

Django-piston ignores "Accept" header #3

thurloat opened this issue Feb 10, 2012 · 0 comments
Milestone

Comments

@thurloat
Copy link
Member

fsang said: "In my setup django-piston always returns json, without honoring the "Content-Type" or "Accept" header."

Example

GET /api/user/1/ HTTP/1.1
Host: test.local:2020
Content-Type: text/xml
Accept: text/xml

HTTP/1.0 200 OK
Date: Tue, 22 Mar 2011 08:47:33 GMT
Server: WSGIServer/0.1 Python/2.4.3
Vary: Authorization
Content-Type: application/json; charset=utf-8

The handler is configured to support JSON and XML:

class UserHandler(BaseHandler):
    allowed_methods = ('GET',)

    @require_mime('xml', 'json',)
    def read(self, request, user):

Reference

https://bitbucket.org/jespern/django-piston/issue/182/django-piston-ignores-accept-header

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant