How does python handle ajax post requests

$.ajax({
  type: "POST",
  url: /cgi-bin/getname.py,
  data: "{"name":"Jack"}",
  dataType: "json",
  success:function(result) {
    console.log(result);
  }
});

for example, the above code sends a request directly to the background. How to use Python to capture json data?
my cgi.FieldStorage (). Getvalue ("name") does not work properly

Apr.11,2022
What is written by

getname.py?


request.body


when I use the Tornado framework, I can get parameters directly using the following code:

 page_size = int(self.get_argument('page_size', 10))
 page_num = int(self.get_argument('page_num', 1))
 

as for your way of obtaining parameters, it is recommended to post part of the logic code in getname.py before you know it.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ed0a8f-490b3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ed0a8f-490b3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?