Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

addPost Error

Hey,

Just starting out with Phalcon and I'm trying to get a REST api working to manage my apps i/o of data but I'm having a major issue trying to add a route via addPost.

The routes.php file has this code:

$router = new Phalcon\Mvc\Router(false);

$router->addGet("/", array(
    'controller' => 'index',
    'action' => 'index',
));

$router->addGet("/register", array(
    'controller' => 'register',
    'action' => 'index',
));

$router->addPost("/api/1.0/company/create", array(
    'controller' => 'ApiController',
    'action' => 'postEndpoint',
));

bootstrap:

    ....

    $application = new Application($di);

    require APP_PATH . 'app/config/routes.php';

    echo $application->handle()->getContent();

addGet() works fine, but with addPost, when I submitted the data via a form to the post url, I just get a blank screen. I've got the debug options turned on so I think I have an issue outside of PHP. Can anyone give me some insight as to what i am doing wrong here?



1.9k
Accepted
answer

Please can this discussion be closed. the Issue was with a security plugin ported over from the INVO tutorial.