Answer the question
In order to leave comments, you need to log in
404 when trying to do REST?
I want to make a simple REST using FosRestBundle, FosUserBundle. I wrote the routing like this:
users:
type: rest
host: localhost
resource: AppBundle\Controller\UserController
public function newUserAction()
{
$user = new User();
$form = $this->createForm(RegistrationFormType::class,$user);
return $this->render('default/new.html.twig', array(
'form' => $form->createView(),
));
}
Answer the question
In order to leave comments, you need to log in
1. Check the routing, especially the annotations.
2. Stop using the production entry point and refer to app_dev.php. You may have routing problems - the cache is not rebuilt.
Refer to localhost/web/app_dev.php/newUser if you are in a dev environment
Check your routing again.
You don't seem to have read the documentation.
symfony.com/doc/master/bundles/FOSRestBundle/5-aut...
If you have chrome: Let's move on. PCM. Translate to Russian. Reading.
If you are silent, then you did not find it. Below is the code from the official documentation:
public function newUsersAction()
{} // "new_users" [GET] /users/new
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question