Hi, > Le 24 mai 2016 à 23:27, 'JS' via Django REST framework > <[email protected]> a écrit : > > Hello, > > I try to test a BasicList View with the api client: > > c = APIClient() > > response = c.post("/mybackend/favorites/cookbook/", data={"name": > "cookbook_1"}) > > > But my response is a django.http.response.HttpResponsePermanentRedirect, and > > response.url > > is a redirect to: > https://testserver:443/mybackend/favorites/cookbook/ > > I expect to get a HTTP 201 created, and when I call my api on a django > testserver with curl, exactly this happens. Why does the API Client want to > redirect somewhere?
The API Client doesn’t do that. It’s your project that does it. You probably have some settings or middleware to force the redirection to https. Regards, Xavier, Linovia. -- You received this message because you are subscribed to the Google Groups "Django REST framework" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
signature.asc
Description: Message signed with OpenPGP using GPGMail
