I set up a tornado http server which receive some multipart form-data request, and store some of the arguments into mysql.
I have read the source code of httpserver_test.py, and found:
...
class HTTPServerTest(AsyncHTTPTestCase, LogTrapTestCase):
def get_app(self):
return Application([("/echo", EchoHandler),
("/typecheck", TypeCheckHandler),
])
def test_query_string_encoding(self):
response = self.fetch("/echo?foo=%C3%A9")
data = json_decode(response.body)
self.assertEqual(data, {u"foo": [u"\u00e9"]})
...
It seems the GET request can be easy test, but I want to test the POST request with multipart form-data parameters, how can I do that?
I have search that MultipartPostHandler module could post multipart form data, but I don't know how to integrate it into tornado.