Kat,

As I said, I'm not privy to the inner workings of the 'read command in
REBOL, so cannot say just what it might be looking for.  I'm only
speculating based on the difference in behaviour we're observing here.  If
it's possible for you to insert some header info before the HTML file that's
returned, why not give that a try.

I would definitely include something like that first line you see in my
samples (HTTP/1.0 200 OK).  Obviously "Content Length" and other info isn't
critical since it's missing from one server's reply or the other.  Perhaps
the "Content Type: text/html" would be important (more to a real browser so
it would know how to process the data that follows).  And maybe the date
line and "Server:" too (although the exact value wouldn't matter).

One key item is the "double newlines" (i.e., blank line) after this
header... as most of these protocols use that to know where the header ends
and the body begins!

Let us know your results.

Russ

------------------------------------
At 06:32 PM 11/3/99 -0600, you wrote:
>Well, like i said, i wrote the server from the port access level up. What
>header would Rebol like, and how is it sent?
>
>Kat
>
>----- Original Message -----
>From: <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Wednesday, November 03, 1999 4:17 PM
>Subject: [REBOL] http server... Re:(6)
>
>
>> Kat,
>>
>> Interesting that what's coming back has no header info in it.  Here are
>the
>> result I see from a local connection (to OmniHTTPd server) and to an
>Apache
>> server on the net (both using Tom Jensen's code) for access:
>>
>> ===============OMNI================
>> HTTP/1.0 200 Document Follows
>> Content-Length: 3567
>> Content-Type: text/html
>> Date: Wed, 03 Nov 1999 22:01:26 GMT
>> Last-Modified: Sun, 17 Nov 1996 02:33:28 GMT
>> Server: OmniHTTPd/1.01 (Win32; i386)
>>
>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
>> <HTML>
>> <HEAD>
>>    <TITLE>Appendix 1</TITLE>
>>    <META NAME="GENERATOR" CONTENT="Mozilla/3.0b6Gold (Win95; I)
>[Netscape]">
>>    <META NAME="Author" CONTENT="Paul Werbicki">
>> </HEAD>
>> <BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#800080"
>> ALINK="#FF0
>> 0FF">
>>
>> <H1><IMG SRC="banner.jpg" HEIGHT=58 WIDTH=408></H1>
>> etc...
>> ================= APACHE ====================
>> HTTP/1.1 200 OK
>> Date: Wed, 03 Nov 1999 22:06:10 GMT
>> Server: Apache/1.2.4
>> Connection: close
>> Content-Type: text/html
>>
>> <html><head><title>Dynamic IP Server</title></head><body>
>> etc...
>>
>> Note the header info in both cases!  I wonder if the 'read http://
>approach
>> is specifically looking for that HTTP/1.x 200 header info on the first
>line?
>> Sorry I don't know the answer to that.
>>
>> Russ
>>
>> PS - the ^m^j^m^j are double LineFeed CarriageReturns required by the HTTP
>> protocol (CRLF or newline work as well if properly 'joined with the rest
>of
>> the command data).
>>
>> eg.,
>>
>> file: "default.htm"
>> insert http-port rejoin["GET /" file " HTTP/1.0" newline newline]
>>
>> -----
>> At 02:39 PM 11/3/99 -0600, you wrote:
>> snip
>>
>> >K, that works:
>> >>> http-port: open tcp://localhost:80
>> >>>
>> >>> insert http-port "GET /dctfiles_new\AA.htm HTTP/1.0^m^j^m^j"
>> >>>
>> >>> while [data: copy http-port] [prin data]
>> ><html>
>> ><h1>A's</h1> <b><sylables>A's</sylables></b> <br>
>> ></html>
>> >== none
>> >>>
>> >
>> >And that is what that file has in it, it's one line. What *is* that
>> >"^m^j^m^j" ? Note the server accepted the slashes either way, that's my
>> >fault, i told it to. What is "== none" ?Then i did:
>> >>> http-port: open tcp://localhost:80
>> >>>
>> >>> insert http-port "GET /HTMLPrimerAll.htm HTTP/1.0^m^j^m^j"
>> >>>
>> >>> while [data: copy http-port] [prin data]
>> >
>> >
>> >And Rebol spit out the 84K file of html. Why is this working and the
>"print
>> >read http://localhost/HTMLPrimerAll.htm " does not work?
>> >
>> >Kat
>>
>>
>
>
>

Reply via email to