Tutorial by Examples

Slim can use withJson() that can return JSON responses with desired route and method $app = new \Slim\App(); $app->get('/api/person', function ($request, $response, $args) { $payload=[]; array_push($payload, array("name"=>"Bob" ,"birth-year"=>1993)); ar...
use \Psr\Http\Message\ServerRequestInterface as Request; use \Psr\Http\Message\ResponseInterface as Response; $app = new \Slim\App; $app->post('/post/data', function (Request $request, Response $response, $arg){ $_input = $request->getParsedBody(); $_data_1 = $_input['name...

Page 1 of 1