Skip to content

Raise exception on unrecognized Content-Type #8

Open
@rattrayalex

Description

@rattrayalex

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]'))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions