Setting multiple cookies on a DRF response

112 views
Skip to first unread message

Stephan Doliov

unread,
Aug 22, 2016, 5:52:33 PM8/22/16
to Django REST framework
Seems that I am either misunderstanding something or trying to get DRF to do something it cannot do.
I want to emit a response and set multiple cookies, say
Set-Cookie: foo=bar ....
and
Set-Cookie: foob=barb ...

but the Response() object in DRF 3.3.3 (at least) takes only a headers argument that is supposed ot be a dictionary, so I cannot have two keys named "Set-Cookie" in said dictionary.  Is this a feature, a bug or something else?

As a side note: the DRF docs illustrate code as in
response = Response()
response
['Cache-Control'] ='no-cache'

But when I try this, I get django telling me that Response() is not callable, what's up with that?

Replies appreciated,
Thanks,
Steve

Reply all
Reply to author
Forward
0 new messages