Thank you very much for this post! It helped me. But I found a bug and an improvement :D
The bug: In the method "test_post_entry" you say "data=urlencode(data)", but it should be "body=urlencode(data)". That is exactly what I was looking for and I realize thanks to the other examples.
And the improvement: I do not know if it is a new feature, but you have a "fetch" method in your AsyncHTTPTestCase class, so you can simplify your classes if: 1.- Your HTTPClientMixin inherits from AsyncHTTPTestCase. Maybe the name of your class has no sense any more if you do this :D 2.- from your methods "get" and "post" you call directly to the fetch method: "self.fetch(url, method='POST', body=data, headers=headers)".
Indeed, maybe it is not necessary your HTTPClientMixin class any more (or can be simplified even more).
Comment
Ey!
Thank you very much for this post! It helped me. But I found a bug and an improvement :D
The bug: In the method "test_post_entry" you say "data=urlencode(data)", but it should be "body=urlencode(data)". That is exactly what I was looking for and I realize thanks to the other examples.
And the improvement: I do not know if it is a new feature, but you have a "fetch" method in your AsyncHTTPTestCase class, so you can simplify your classes if:
1.- Your HTTPClientMixin inherits from AsyncHTTPTestCase. Maybe the name of your class has no sense any more if you do this :D
2.- from your methods "get" and "post" you call directly to the fetch method: "self.fetch(url, method='POST', body=data, headers=headers)".
Indeed, maybe it is not necessary your HTTPClientMixin class any more (or can be simplified even more).
Maybe you finally forked the Tornado's core?