Reputation: 313
I'm looking for a maven artifact or some pre-existing framework that will turn making http requests into a 1 liner. For those familiar with Ruby, I'm thinking about something alomg the lines of Httparty which supports get, put, post... etc.
ex:
Response response = SomeLibrary.get("https://api.google.com/maps")
int code = response.code
String body = response.body
Upvotes: 1
Views: 2129
Reputation: 3377
we use apache commons http
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
It is very easy and supports many functions altough it is not a one liner.
Upvotes: 2