I used Swagger to generate a Slim framework for a server. Without editing anything, I am testing the basic functions. I have one located at /user/login
. Here is the script I have for it:
$app = new Slim\App();
$app->POST('/user/login', function($request, $response, $args) {
$queryParams = $request->getQueryParams();
$username = $queryParams['username'];
$password = $queryParams['password'];
$response->write("Will not work");
return $response;
});
$app->GET('/user/{user_id}', function($request, $response, $args) {
$response->write('Works');
return $response;
});
However, when I try to POST
to the url using Postman (chrome app), it results in a 500 error. If I try any of the GET
methods, it works. It only seems to be happening with the POST
methods.
I have it running on an Ubuntu machine, with Apache2 installed with PHP. I have updated everything to the latest available versions. ModRewrite
is enabled, and the override is set to all. Please help! I am at such as loss at this point.