grails-plugins / grails-rest-client-builder

REST client plugin that uses Spring's RestTemplate
http://grails.org/plugin/rest-client-builder
Apache License 2.0
65 stars 32 forks source link

JSON body comes empty #37

Closed aruizca closed 9 years ago

aruizca commented 9 years ago

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'
            ])
        }
aruizca commented 9 years ago

It worked with a post. Can someone tell me why please?

graemerocher commented 9 years ago

Currently GET requests do not support a message body

aruizca commented 9 years ago

You mean because it is not implemented in this plugin, right?

abobwhite commented 7 years ago

@aruizca I believe that's what he meant...because that's the standard. Just because you CAN put a body on GET request doesn't mean you should.

http://stackoverflow.com/a/983458/1721440