0

I'm making an application which sends an POST request using ajax to a python script. I'm new to python and doesn't know much about it. As in PHP we do something like this to get a value from post request.

$val = $_POST['data'];

How to do this in python? any help would be appreciated. Thanks

Asad ullah
  • 620
  • 2
  • 9
  • 26

1 Answers1

1

You can get that using raw cgi

For example:

import cgi
form = cgi.FieldStorage()
print form["username"]

Everything is explained really well here

Muhammad Usman
  • 10,039
  • 22
  • 39