Wednesday, September 27, 2017

1.9 - GET requests without Content-Type specified given text/plain content type

Hi,

If I'm running my app locally with ./manage.py runserver when I make a GET request without specifying a Content-Type header the request object in django has request.META['CONTENT_TYPE'] == 'text/plain'.

I can't for the life of me work out where this is coming from, I'm reasonably sure the GET request I send is not defaulting to adding a Content-Type header with the value of text/plain (I have tried the GET request using python-requests and the Postman chrome extension, same behaviour in both cases), and it does not appear to be the value of DEFAULT_CONTENT_TYPE as I changed that to something other than text/plainn and my GET requests still had a request.META['CONTENT_TYPE'] == 'text/plain'.

Is this the expected behaviour? Is there any way to stop it?

Cheers,

Pete 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/44596b8f-3c3e-4056-be0b-a6cf2288fc9d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment