Thread: Help with http

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2012
    Posts
    3
    Rep Power
    0

    Help with http


    Hi all,
    I need some help understanding how the second line works:

    Code:
    // Make a HTTP request:
        client.println("GET /search?q=arduino HTTP/1.0");
        client.println();
    The complete program can be found at http://arduino.cc/en/Tutorial/WebClient

    I have been looking up info about RFC2616 but it's not helping much. I need simple examlpes of how I would use "GET" with it not being in a program. Would I use it in an html file or safari browser? Could I use "get" on a LAN setup and not the internet? At this point I'm not sure how to ask the question yet!

    FYI, an Arduino is a SBC with an ethernet shield attached, that is programmed and able to control things.

    Thanks for any help.
    If this should be in another area of the forum let me know?
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2012
    Posts
    3
    Rep Power
    0
    Anyone?

    I found some helpful video's on youtube by mikenku. His intro to wireshark is good but now I have more questions.
    Last edited by Fastn8tor; February 16th, 2012 at 12:40 PM. Reason: able to fix first message
  4. #3
  5. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6352
    Once you establish a connection to a remote server, that server supports various commands.

    If you open an HTTP session, the commands the server supports are limited to OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT, and PATCH.

    So what you're doing here is:
    1) Connect to server.

    2) Ask the server "I would like to GET the file `search` in your web root, with the argument q equal to "arduino". Please use HTTP/1.0 in your response."
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2012
    Posts
    3
    Rep Power
    0
    Thanks Dan for your reply.

    Is it possible to GET a "file" from my LAN without actually running a server such as apache? I think that the answer is no but I'm not sure.
  8. #5
  9. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6352
    You need some kind of server to serve files. FTP, HTTP, SAMBA, SFTP, SSH, (etc etc unto ten generations).

    You definitely absolutely need a web server to execute PHP files and return the output to you. If you just want to pull down the PHP source file without executing it, regular old file servers will work.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.

IMN logo majestic logo threadwatch logo seochat tools logo