I have been exploring serverless php for and I opted on using slim framework because I find it easier to just plugin modules as I go and that what I am building is just landing pages with a few forms. So I have made the landing pages on slim framework and had it working on traditional servers like micro instances but when I migrated it on serverless php specifically using bref but the post method does not seem to work anymore.
I consume the API I made using slim + bref serverless via AJAX. I passed the contentType : application/json
, with a POST
method but still not working.
I have used the following methods:
$request->getParsedBody()
-> this works fine on a non-serverless framework. But on serverless php bref it went "internal server error"$_POST
-> works fine locally and traditional servers but on cloudwatch and var_dumping it is empty array.$request->getParams()
(not working no method of that is existing but I saw it here in Stackoverflow)
The work around I found was to have it on GET method but I actually want to use POST method because I'd like to use it on passwords.
Anyone who has experienced the same?
Thanks