Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

cURL equivalent in Java?

 
Jason Bock
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What library is recommend for retrieving (or POSTing) to/from web pages?

In PHP I would usually use cURL, but what is the equivalent in Java?

I need to be able to do such things as
- set the useragent
- set the timeout for pageloads
- allow redirects
- set the referer
- retrieval method (get/post)
- set or retrieve cookies
- set the proxy

etc.

Suggestions?

PS: I did find the Apache commons http library, but does it allow all these functions?
 
Paul Clapham
Sheriff
Posts: 21892
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, that's the thing to use. As far as I know it does all those things.
 
Jason Bock
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've come across a javacurl library. Does anyone have any experience with it?
 
Dragan Stankovic
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't have experience with javacurl but I'll definitely try htmlunit.

I've used it for several projects and I am very satisfied with it.
 
Campbell Ritchie
Marshal
Posts: 52632
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not a "beginner's" question. Moving.

I hope I have moved it to the right place.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!