Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP POST method not recognized by controller #10067

Closed
acrive82 opened this issue Jul 27, 2016 · 2 comments
Closed

HTTP POST method not recognized by controller #10067

acrive82 opened this issue Jul 27, 2016 · 2 comments

Comments

@acrive82
Copy link

acrive82 commented Jul 27, 2016

After create a Grails 3.1.9 app with rest-api profile and using the static method allowedMethods to bind the POST to save action, the request will not mapped to the action. Go directly to index.

Debugging the application I found the correct request method (POST), but will never respond the save action.

If I try to call the action directly (following the conventions) POST http://localhost:8080/mymodel/save, all work!

Steps to Reproduce

  1. Create application with rest-api profile
  2. Generate model and controller
  3. Map an action to POST with allowedMethods map
  4. Execute a request (POST)

Expected Behaviour

Call mapped POST action (default save)

Actual Behaviour

Respond index

Environment Information

  • Operating System: Ubuntu 16.04
  • Grails Version: 3.1.9
  • JDK Version: 1.8
@graemerocher
Copy link
Member

You are almost certainly missing the necessary URL mapping in UrlMappings.groovy. Example:

  "/foos"(resources:"foo")

@acrive82
Copy link
Author

Oops. Thank for your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants