8000 Accept: 'application/json; indent=4' not working. · Issue #69 · flask-api/flask-api · GitHub
[go: up one dir, main page]

Skip to content
8000
Accept: 'application/json; indent=4' not working. #69
Open
@sohaibfarooqi

Description

@sohaibfarooqi

Hi,
The header mentioned in question title is raising:
Exception:flask_api.exceptions.NotAcceptable: Could not satisfy the request Accept header
I am trying the demo app using Postman to test request.
Any ideas why is this not loading JSONRenderer() object?

EDIT:
What i understand from further debugging is that select_renderer() from Class DefaultNegotiation tries to match application/json and application/json;indent=4 through satisfies() from Class Media. But server_media_type is initialized to JSONRenderer media_type attribute. I added following check to the satisfies() and it works:

if self.full_type == other.full_type:
            return True

Is this correct? Or there is some other way of doing it without modifying the code?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0