2

Trying to reach my REST endpoint the request.JSON is empty after executing this:

RestResponse response = rest.get("http://localhost:8080/${grailsApplication.metadata.'app.name'}/ws/question") {
    json([
        occurrenceId: 'f6f8a9b8-4d52-49c3-9352-155f154fc96c',
        userId: userKeef.alaUserId,
        tags: 'octopus, orange',
        comment: 'whatever'
    ])
}

but it works with a POST request: rest.post(...

aruizca
  • 1,761
  • 1
  • 16
  • 13
  • 1
    have you seen http://stackoverflow.com/questions/3477333/what-is-the-difference-between-post-and-get, ie get only sends url+querystring – Astra Bear Mar 19 '15 at 22:46
  • Thanks Astra Bear! According to this you can send a body in a GET request. Although it is not a good practice -> http://stackoverflow.com/questions/978061/http-get-with-request-body – aruizca Mar 19 '15 at 23:00
  • maybe grails is protecting you from your dark thoughts? – Astra Bear Mar 19 '15 at 23:13

0 Answers0