Hi,
I looked around the list and couldn't find any mention of this subject.

In `django.http.request.HttpRequest._load_post_and_files()` there is 
explicit mention of two content type ('multipart/form-data' and 
'application/x-www-form-urlencoded'), any other content type will get empty 
values for self._post.

Given that a lot of user form interaction is now happening through 
'XMLHttpRequest', I think that the 'application/json' content type should 
be supported. A lot of javascript libraries will use json as the default 
format:
* angularjs: http://docs.angularjs.org/api/ng.$http, see "Setting HTTP 
Headers"
* emberjs: 
https://github.com/emberjs/data/blob/master/packages/ember-data/lib/adapters/rest_adapter.js#L974
* backbone: http://backbonejs.org/#Sync
* jquery: http://api.jquery.com/jQuery.ajax/ (the only one using 
'application/x-www-form-urlencoded' by default)

I'm trying primarily to create a discussion on the subject and am ready to 
provide the code for it as I had to write it. This would help avoid hacks 
to handle the request object in my view. 

I know there are some apps to handle API construction (django-tastypie, 
django-rest, django-piston and certainly others) they use either request 
wrappers or request handling in their views.

Stefan

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to