django-rest-framework icon indicating copy to clipboard operation
django-rest-framework copied to clipboard

Override content type?

Open elainen opened this issue 12 years ago • 2 comments

I'm using IE9's XDomainRequest to make a request to a DRF api and I'm getting a 415. I understand when sending an XDomainRequest we can't send a custom content type header but only text/plain. We noticed there is a way to override the content type using a form field (FORM_CONTENTTYPE_OVERRIDE). Is there a way to do it in the url instead? Alternatively, is there an easier way to tell DRF to handle my request as x-www-form-urlencoded, or do I have to provide a custom negotiation class?

elainen avatar Jul 01 '14 22:07 elainen

Hiya,

This sort of usage question is probably better suited to the discussion group, as it's not really a bug or feature request. It does sound like a custom negotiation class would be your best bet.

lovelydinosaur avatar Jul 02 '14 08:07 lovelydinosaur

@tomchristie I think this actually is a feature request; it would be really nice if there were a URL_CONTENTTYPE_OVERRIDE that worked like the similar settings URL_FORMAT_OVERRIDE and URL_ACCEPT_OVERRIDE.

matthewwithanm avatar Jul 31 '14 16:07 matthewwithanm