I am trying to send data to a python script via POST but unable to read it. The UI is in AngularJS. I have seen similar questions but they are either not using AngularJS or not using POST.
The Angular code:
$scope.send = function(){
$data = {
"tableData":$scope.personsSelected
}
$postData = JSON.stringify($data);
Services.post('testbed.cgi', $postData);
}
Python Code:
formData = cgi.FieldStorage()
print json.dumps(formData)
Error Message:
TypeError: FieldStorage(None, None, []) is not JSON serializable
I have tried setting the content type to application/x-www-form-urlencoded but to no avail. What am I missing here?