Find the answer to your Linux question:
Results 1 to 5 of 5
Can anyone suggest a command line way of making a simple http request? Basically I want to make a shell script that will periodically request a cgi script on a ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie pajamabama's Avatar
    Join Date
    Jul 2005
    Location
    In another time's forgotten space
    Posts
    150

    command line http request


    Can anyone suggest a command line way of making a simple http request? Basically I want to make a shell script that will periodically request a cgi script on a web server. I just want to make the requset, I don't need to see the response. can lynx be used in this way?

    Thanks.
    HP Pavilion dv6000t
    Intel Centrino Duo 2.0GHz
    nVidia GeForce Go 7400
    Fedora 10

    ----------------------
    The real question is what time is it and why the hell am I still screwing around with my computer?

  2. #2
    Just Joined!
    Join Date
    Feb 2006
    Location
    Canada
    Posts
    7
    If you mean you want to call the script with variables, if the script takes a GET input, just call the script like:
    scriptURL?var1=aaa&var2=bbb&var3=ccc and so on.

  3. #3
    Linux Newbie pajamabama's Avatar
    Join Date
    Jul 2005
    Location
    In another time's forgotten space
    Posts
    150
    no, I'm looking for a command line utility that will make an http request. Something like ping, except that it does http.

    I want to be able to say something like:

    Code:
    >cool_http_util http://www.pedorro.com/my_cgi.cgi
    so that it activates the CGI script on the server.
    HP Pavilion dv6000t
    Intel Centrino Duo 2.0GHz
    nVidia GeForce Go 7400
    Fedora 10

    ----------------------
    The real question is what time is it and why the hell am I still screwing around with my computer?

  4. #4
    Just Joined!
    Join Date
    Feb 2006
    Location
    Canada
    Posts
    7
    What about using wget? I just tested it on a script of mine that emails me when it's called in the browser and wget made it email me.

  5. #5
    Linux Newbie pajamabama's Avatar
    Join Date
    Jul 2005
    Location
    In another time's forgotten space
    Posts
    150
    thanks!

    Code:
    wget --spider http://...
    will suppress the actual download feature which is what I want.

    It looks like 'curl' also does the trick.
    HP Pavilion dv6000t
    Intel Centrino Duo 2.0GHz
    nVidia GeForce Go 7400
    Fedora 10

    ----------------------
    The real question is what time is it and why the hell am I still screwing around with my computer?

Posting Permissions

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