Skip to content

Adding Response Headers #1

Open
@marqpdx

Description

@marqpdx

I am wanting to use this with React Admin, which requires an 'X-Total-Count' response header. i was able to hard-code it (see below) but i am wondering if there are thoughts about having a config for additional resp. headers we might add?

Thanks!

            theData = [BookClubSerializer(instance=obj).data for obj in BookClub.objects.all()]
            resp = Response(theData, status=200)
            resp.headers['X-Total-Count'] = 2
            resp.headers['Access-Control-Expose-Headers'] = 'X-Total-Count'
            return resp

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions