Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using the tornado RequestHandler is it possible to get POST data without specifying a argument?

Tags:

python

tornado

I am trying to get the POST data from this CURL statement:

curl -d 'DATA HERE' http://localhost:8888/

I cannot find a method to do this, at the moment I am using an argument in the POST request:

curl -d 'data=test' http://localhost:8888/

and this to retrieve the data:

postData = self.get_argument('data', 'No data')

That works fine but I do not want to have to specify a POST argument.

like image 270
S-K' Avatar asked Nov 28 '12 19:11

S-K'


1 Answers

The raw body from a post request is in self.request.body

like image 151
koblas Avatar answered Sep 24 '22 15:09

koblas