Reputation: 23323
Is it possible not to use custom API but simply send JSON request and recieve JSON response (use REST api)?
Upvotes: 1
Views: 794
Reputation: 26791
So by saying "is it possible not to use custom API", you mean you don't want to use something like HttpBuilder, you just want to use raw groovy?
If you're only doing GETs, you can just us the URL class and it's text
method, and manually parse the JSON, but that is very limited.
If you need to do POST/PUT/DELETE/HEAD/etc, you're probably better off using something like HttpBuilder. If that's not an option, you're left with implementing a subset of what HttpBuilder or HttpClient performs.
Upvotes: 3