How would you consume a RESTful API using Java with probably just the standard packages? For ex: Twitter API. I know there are great Java libraries to access it, but how would you start from scratch?
Asked
Active
Viewed 2.2k times
10
-
you should probably have a look at @bhagyas answer. The most appropriate I feel – Jatin Apr 20 '13 at 13:53
2 Answers
8
Well, there are many ways you could access RESTful API using Java third party libraries, like using Apache Http Client or using Sun Jersey API.
You could also use the native java.net.HttpURLConnection to consume REST Services

codinguser
- 5,562
- 2
- 33
- 40

James Khoo
- 1,209
- 2
- 14
- 19
5
Don't think you should start from scratch, however Spring's RestTemplate is something you can simple use to consume RESTful Services.
http://blog.springsource.com/2009/03/27/rest-in-spring-3-resttemplate/
Cheers.

bhagyas
- 3,050
- 1
- 23
- 21