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

Raise exception on unrecognized Content-Type #8

Open
rattrayalex opened this issue May 8, 2016 · 1 comment
Open

Raise exception on unrecognized Content-Type #8

rattrayalex opened this issue May 8, 2016 · 1 comment

Comments

@rattrayalex
Copy link

https://github.com/graphql-python/graphql-django-view/blob/master/graphql_django_view/__init__.py#L93 will tell the user:

<HttpResponseBadRequest status_code=400, "application/json">
b'{"errors":[{"message":"Must provide query string."}]}'

if the content-type is unexpected. An informative exception should be raised instead, eg:

raise HttpError(HttpResponseBadRequest('Unrecognized content-type: text/plain. Please send one of [application/graphql, application/json, application/x-www-form-urlencoded, multipart/form-data]'))

@syrusakbary
Copy link
Collaborator

Makes sense!

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

No branches or pull requests

2 participants