1. Alexander Herrmann
  2. django-piston
  3. Issues
Issue #2 invalid

HttpResponseWrapper returns “status” string to client

Ming Chan
created an issue

When you do the following in the handler

resp = rc.CREATED

return resp

It returns the “created” text as response to the client. It’s good for debugging but It is not good for my case since in my POST operation, it will return “some sort of tracking id”. Now if you do this

resp = rc.CREATED

resp.write (“<response>111</response>”)

return resp

At the client, side, you will get

Created<response>111</response>

It is not what you want…

Should get rid of the return “status” by modifying line 74 in utils as following

from return HttpResponseWrapper(r, content_type='text/plain', status=c)

to

return HttpResponseWrapper(content_type='text/plain', status=c)

Comments (1)

  1. Log in to comment