1. Jesper Nøhr
  2. django-piston
Issue #99 resolved

Bad Request and Content-Type (with FIX)

Anonymous created an issue

Problem: Get a bad request HTTP 400 error when my content-type is set to

Content-Type application/x-www-form-urlencoded; charset=UTF-8

Fix:

piston/utils.py

    type_formencoded = "application/x-www-form-urlencoded"

    ctype = self.request.META.get('CONTENT_TYPE', type_formencoded)
if ctype == type_formencoded:

FIX: <<<< if ctype.find(type_formencoded)!=-1:

Then it should work as expected.

Comments (2)

  1. Log in to comment