Results 1 to 5 of 5

Thread: HTTP Request

  1. #1
    Join Date
    May 2006
    Location
    Alaska
    Posts
    163
    Thanks
    5
    Thanked 2 Times in 2 Posts

    Default HTTP Request

    I don't know all that much about HTTP Requests, but I'm wondering, can you receive two files from one request? What I want to do is eventually make my own HTTP Server in probably Java, and I want it to be able to pass variables to Javascript. I could have a "server variable definition" script block on every page, but it would be neater if it could be an external js file. Can I reasonably do this?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    As I understand it, one file per request. Multiple request are made for the typical page:

    • the page itself
    • /favicon.ico (and/or variations on that depending upon a number of factors)
    • each image is a separate request
    • each linked style file is separate
    • each external script is separate
    • any Flash file(s) - each separate as well


    There could be other resources required for the page, these would each be separate requests.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    The server serves only data. It's up to the client to decide what constitutes a 'file' — multiple requests may go into a single file, or the client may split a single request into multiple files. Most current Web browsers generally follow the 'one request, one file' rule, though.

    A webserver in Java? That sounds like reinventing the wheel square, strapping one's self to the outside, and rolling down a hill covered in brambles. Allow me to recommend Haskell.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #4
    Join Date
    May 2006
    Location
    Alaska
    Posts
    163
    Thanks
    5
    Thanked 2 Times in 2 Posts

    Default

    Quote Originally Posted by Twey View Post
    A webserver in Java? That sounds like reinventing the wheel square, strapping one's self to the outside, and rolling down a hill covered in brambles. Allow me to recommend Haskell.
    LOL, thanks though. Haskell?

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    http://www.haskell.org/

    Also good for large concurrent applications is Erlang, although it has only a weak type system, so it might be less than ideal. On that latter note, there's also Python if you prefer imperative languages.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •