I use Postman (in Chrome) to test subtle calls, but can't figure out how to get any published JSON data.
Im sending raw JSON:
{"name":"John Smith", "age":"30", "gender":"male"}
With Content-Type: application / json in title
through POST:
http://domain/api/v1/users/post/test/
Every attempt to get JSON data gives a fatal error (see code comments below)
<?php require 'vendor/autoload.php'; $app = new \Slim\Slim(); $app->add(new \Slim\Middleware\ContentTypes()); $app->group('/api/v1', function () use ($app) { $app->group('/users/post', function () use ($app) { $app->post('/test/', function () { print_r($app->request->headers);
What am I missing?
Thanks!
source share