views:

86

answers:

3

Hi,

I'm looking for the best way to stream live data over the http protocol with java.

I'm currently using HttpURLConnection to receive json feeds, I would like to know if it can be used to stream feeds too.

+2  A: 

I use Apache HTTP Client, which is more evoluated.

chburd
Apache HTTP Client (3.x) is deprecated. Current code is in HttpComponents: http://hc.apache.org/
Nakedible
+1  A: 

If you are looking for the "best" way to stream HTTP and JSON, I would suggest going with Apache HttpComponents and Jackson JSON library.

However, if you are just looking for streaming of a HttpURLConnection, the getInputStream method should provide for that.

Nakedible
A: 

I like the Jersey Client. But really, you could probably pick any of these large framework components and have a decent solution. The difference maker is preference, e.g. I like the builder methods that the client provides, but you could use 100% Spring with the CXF JaxWsProxyFactoryBean.

Droo