Skip to content

Commit

Permalink
remember the json request. #1293
Browse files Browse the repository at this point in the history
  • Loading branch information
wellingguzman committed Nov 2, 2016
1 parent 6b58d1c commit bd94dc4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion api/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,11 @@
// @TODO: Use the Slim request instead of the global php $_GET
$params = $app->request->get();
// @TODO: Use the post method instead of parsing the body ourselves.
$requestPayload = $app->request->post();
if ($app->request->getContentType() === 'application/json') {
$requestPayload = json_decode($app->request->getBody(), true);
} else {
$requestPayload = $app->request->post();
}

$endpoints = Bootstrap::getCustomEndpoints();
foreach ($endpoints as $endpoint) {
Expand Down

0 comments on commit bd94dc4

Please sign in to comment.