Quantcast

Send JSON and consume reply in a Grails Service?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Send JSON and consume reply in a Grails Service?

marcopas
I have a need to send a JSON request to a system and read the response
on that request (as JSON).
I was wondering if that can be done using a service? I read some posts
on using the HTTPBuilder in the service for that but i am not sure if
that is the correct way?

Any hints?

/Marco

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Send JSON and consume reply in a Grails Service?

Ian Roberts
On 13/06/2012 14:52, Marco Pas wrote:
> I have a need to send a JSON request to a system and read the response
> on that request (as JSON).
> I was wondering if that can be done using a service? I read some posts
> on using the HTTPBuilder in the service for that but i am not sure if
> that is the correct way?

I've used HTTPBuilder (via the rest plugin) to do this sort of thing
before, and it worked very well.

Ian

--
Ian Roberts               | Department of Computer Science
[hidden email]  | University of Sheffield, UK

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Send JSON and consume reply in a Grails Service?

a.shneyderman
In reply to this post by marcopas
HttpClient is part of grails. You can use it to make the call.

You could use grails's JSON conversion mechanism to convert to JSON.

Although, I would recommend Jackson as it does I think a bit better
job on formatting.

On Wed, Jun 13, 2012 at 3:52 PM, Marco Pas <[hidden email]> wrote:

> I have a need to send a JSON request to a system and read the response
> on that request (as JSON).
> I was wondering if that can be done using a service? I read some posts
> on using the HTTPBuilder in the service for that but i am not sure if
> that is the correct way?
>
> Any hints?
>
> /Marco
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Loading...