Announcement

Collapse
No announcement yet.

Chad's Web Get Code In Source Code Forum

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Chad's Web Get Code In Source Code Forum

    hey all,

    this post refers to chad wood's webget code in the source code forum: http://www.powerbasic.com/support/pb...ad.php?t=24302

    changing the following line:

    Code:
    tcp print #1, "get " & file & " http/1.1"
    to the following
    Code:
    tcp print #1, "get " & file & " http/1.0"
    causes everything to work fine for me. i'm running windows 2000 and xp with all the latest service packs.

    any ideas on why http 1.1 would be the cause? both web servers (iis and weblogic) that i'm testing with support 1.1. does http 1.1 send data down to the client differently?

    scott


    ------------------
    scott wolfington
    http://www.boogietools.com



    [this message has been edited by scott wolfington (edited july 08, 2004).]
    Scott Wolfington
    [url="http://www.boogietools.com"]http://www.boogietools.com[/url]

  • #2
    Here's some information I found regarding HTTP 1.1. I found this information at the following link: http://www.ictp.trieste.it/~its/1999...ttp/sld009.htm


    The version 1.1 of HTTP presents a few important differences with respect to the previous version:


    *The client request must include a Host: header containing the host parto of the remote URI. The reason is to make easy for a server running more virtual servers to identify which one should be the target of a given request.

    *It is possible the so called chunked transfer-encoding. I.e. the server may start sending data even before knowing the total length of the data.

    *The default connection mechanism tries to keep alive the TCP connection to allow further exchange of data without starting a new connection.

    *In a HTTP transaction, client and server agree on the lower level of the protocol.

    *Notice that about 3/4 of nowadays HTTP transactions are still obeying HTTP 1.0 even if 1.1 is available since 1998.

    The bolded statement above is probably the reason some of us have seen the connection to the web server seem to hang until the connection times out, and then returning with all the data. Just a thought. Anyway, I'm using HTTP/1.0 in my request now, and everything seems great. Hope someone finds this information useful.

    Cheers,
    Scott


    ------------------
    Scott Wolfington
    http://www.boogietools.com



    [This message has been edited by Scott Wolfington (edited July 08, 2004).]
    Scott Wolfington
    [url="http://www.boogietools.com"]http://www.boogietools.com[/url]

    Comment


    • #3
      In case anyone is having trouble with this and needs to use HTTP 1.1 (virtual servers sometimes require it) then this seems to work.

      Persistent Connections and the "Connection: close" Header

      If an HTTP 1.1 client sends multiple requests through a single connection, the server should send responses back in the same order as the requests-- this is all it takes for a server to support persistent connections.

      If a request includes the "Connection: close" header, that request is the final one for the connection and the server should close the connection after sending the response. Also, the server should close an idle connection after some timeout period (can be anything; 10 seconds is fine).

      If you don't want to support persistent connections, include the "Connection: close" header in the response. Use this header whenever you want to close the connection, even if not all requests have been fulfilled. The header says that the connection will be closed after the current response, and a valid HTTP 1.1 client will handle it correctly.

      ------------------




      [This message has been edited by Mike Charnock (edited March 12, 2005).]

      Comment


      • #4
        Great find Mike. Thanks for sharing.

        Scott


        ------------------
        Scott Wolfington
        http://www.boogietools.com
        Scott Wolfington
        [url="http://www.boogietools.com"]http://www.boogietools.com[/url]

        Comment

        Working...
        X