🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #15186

Reading a http URL with simple text.

#15186
From: Gary Klein
Date: Sat, 03 Jul 1999 00:00
21 lines
1387 bytes
I'm trying to read a string from an http webserver which gives the
time.
I'm supposed to be able to just read a string from this input after I
make the connection. Here's what I do:

      String url = new(http:xxx.xx.xxx);
      URL webtime = new URL(url);
      connection = webtime.openConnection();
      connection.setDoInput(true);
     DataInputStream timestream = new
DataInputStream(webtime.openStream());
     String UTCline = timestream.readLine();
     System.out.println(UTCline);

      The first 5 characters of this string are supposed to be a
Julian date then a space followed by yy-mm-dd hh:mm:ss, ect.
However the string starts with the yy-mm-dd. The Julian date is lost.
I know that its there because It shows up when I just put the URL
address in a browser. What am I doing wrong? Or is it them?

Thanks for the help.
Technical Details
Message-ID: <7llt3h$6ch1@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,414c6c46db24b753,start
X-Google-Attributes: gidf74b3,public
From: "Gary Klein" <mrgaryk@yahoo.com>
Subject: Reading a http URL with simple text.
Date: 1999/07/03
Message-ID: <7llt3h$6ch1@forums.borland.com>
X-Deja-AN: 496865857
Content-Transfer-Encoding: 7bit
Organization: Eolas
Content-Type: text/plain; charset="iso-8859-1"
Mime-Version: 1.0
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Newsgroups: borland.public.jbuilder.java.language