Empty route path for different methods in symfony

Viewed 984

I'm developing an API using Symfony and FOSRestBundle, and want to use the following routes:

app/config/routing.yml

page:
  prefix: /page
  resource: "@PageBundle/Resources/config/routing.yml"

PageBundle/Resources/Config/routing.yml

page_get:
  path: /{id}
  methods: GET
  defaults:
    _controller: PageBundle:Page:get
    id: null

page_post:
  path: /
  methods: POST
  defaults:
    _controller: PageBundle:Page:post

The same for PUT and DELETE...

When I call GET for /page works fine, but when call POST for /page I get the following error:

No route found for "POST /page": Method Not Allowed (Allow: GET, HEAD)

I need to call /page/ instead of /page, then it works...

What can I do to use the same empty path for differents methods?

Sorry for my bad english.

1 Answers
Related