Im currently experiencing a bug caused by not attaching the header Content-Type
in a curl request.
With a correct request
curl -v -XPOST -H'Content-Type: image/png' -d@image.png "localhost:9000"
The RequestHandler.request.arguments.items()
is a clean list []
However, if I remove the -H'Content-Type: image/png'
header, and just do something like:
curl -v -XPOST -d@image.png "localhost:9000"
arguments.items()
will be come completely messed up - it now contains a list of random unicodes that looks kind of like this:
[('', ['\x19\xf4cX0\xd4A\x86\xd2\x90\x0e\xcf\xa9p\xe5\x82:\x8c\xa8VJz\xc4\xd8Pa\xbfr\xb9`\xc7\xa4\xa8\x90<\xb5\xe3\xd4\x15\xb8\xb9\xfec.*\xff\xd7\xe0rb\xae\x16\x9a\xf5\x08\x9e\xc5\x7f\xd0\x8b\xdf\x9d\x0fQ2, ......
Which I assume to be the content of the image I've attached.
How can I resolve this problem? Is there certain flag/function/etc that I can use inside tornado that would prevent the data from being lost? Or do I have to make the user to include the 'Content-Type'
header?
EDIT:
Sorry that I didn't make this clearer earlier, I want to extract the stuff inside RequestHandler.request.arguments.items()
, which may contains some values that I need.