• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HTTP Request

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I couldn't find out how to make a simple HTTP-Request (like one in the Browser) from a java application (J2SE).
Response from Server can be ignored, i just want to make the request with a few GET data.
e.g.: request("http://www.xyz.com?name=info&atr=3");
Is this possible?
Thanks a lot for your help!
Peter
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's certainly possible. I've seen more than one Java-based web browser.
I've used two testing tools that are capable of making various http requests. You might want to take a look at how HtmlUnit or HttpUnit accomplish it. They're both open source projects listed at SourceForge.net.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also, something in the java.net package might get the job done easily for you. HttpURLConnection looks promising.
[ June 23, 2003: Message edited by: Dirk Schreckmann ]
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's something I have used to fetch HTML pages. For images or other binary files, you might want to read bytes instead of lines.
 
reply
    Bookmark Topic Watch Topic
  • New Topic