★ wanayoo — archive 1999 http://wdvl.com/Authoring/Scripting/Tutorial/java_get_data_from_server.htmlNouvelle recherche | Portail wanayoo

Free Internet Technology info! logo

internet.com
Join the free
WDVL newsletter!

home

Getting Information from a Remote Site

  • So once you have a connection to a web server it is likely that the first thing you will want to do is get data. Getting data from a web server is as easy as opening a connection and uses a data stream to handle the flow of data between your application and the server.

  • Typically, you will read in a data file from a given URL using something like the following:

    try
      {
      Socket s = new Socket("www.extropia.com", 
                             80);
      DataInputStream d = new DataInputStream
                          (s.getInputStream());
      String line = d.readLine();
      System.out.println("line: " + line);
      
      System.out.println("" + url.openStream());
      }
    catch (IOException e)
      {
      System.out.println("Error: " + e);
      }
    

Additional Resources:

Connecting to a Server
Table of Contents
Sending Information to a Remote Site

Up to => Home / Authoring / Scripting / Tutorial

Instantly look up a "techie" word using Webopedia!!


internet.com
e-commerce
WebDeveloper Network


Free Web Developer Info!

Copyright 1999 internet.com Corporation. Legal Notices. Privacy Policy.

www.internet.com