Embarked on aws lambda platform, attempted running python sub process function for invoking php url, which did not yield the desired outcome. Here given below the code for your ready reference:
import json
import subprocess
# if the script don't need output.
subprocess.call('php https://mbracecloud.com/post_form.php', stdin=None, stdout=None, stderr=None, shell=False)
On running this code, we encounter this error:
"errorMessage": "[Errno 2] No such file or directory: 'php https://mbracecloud.com/post_form.php'",
"errorType": "FileNotFoundError",
Though the file exists, it is displaying error "file not found"
Edit:
Okay based on what maurice said, followed the new code of python standard library from another thread. Ran the code below:
import requests
r = requests.post("http://bugs.python.org", data={'number': 12524, 'type': 'issue', 'action': 'show'})
print(r.status_code, r.reason)
There seems to some problem with import "request". How do i overcome this ?
Response:
{
"errorMessage": "Unable to import module 'lambda_function': No module named 'requests'",
"errorType": "Runtime.ImportModuleError"
}