It is currently Mon, 27 Jun 2022 12:08:03 GMT



 
Author Message
 Make HTTP request from Unix shell script
Hi all,

is it possible to make an HTTP request from a Unix shell script? I know
I could use Perl to do this or even use the C library available at
www.w3c.org, but I'd rather find a solution that doesn't require the
installation of any component.

I managed to make an HTTP request by doing a telnet on port 80 (on
which my web server listens), but this opens a shell and then I have to
type the appropriate command to get the HTML (for instance, "GET
/index.html"). Is it possible to do that automatically (i.e. telnet
doesn't open a shell but opens the connection and then automatically
execute the query)?

Is there another way to do this?

Thanks

Olivier

Sent via Deja.com http://www.**-**.com/
Before you buy.



 Tue, 17 Dec 2002 03:00:00 GMT   
 Make HTTP request from Unix shell script

[snip]

In ksh/zsh/bash:

----- snip -----

telnet www.domain.com 80 2>/dev/null |&

{
        cat <<EOF
GET / HTTP/1.0
Host: www.domain.com

EOF

cat <&p

----- snip -----

Zlo



 Tue, 17 Dec 2002 03:00:00 GMT   
 Make HTTP request from Unix shell script
Hi,

I recomend that you get the following:

wget - this will get web pages or files off webpages
striphtml - strips HTML tags (< >)

John



 Tue, 17 Dec 2002 03:00:00 GMT   
 Make HTTP request from Unix shell script
In article <8ji7k9$6q...@nnrp1.deja.com>,

You could use lynx, a unix text browser.

man lynx

for example:

lynx -dump http://www.tiac.net/users/demas

would dump the page to std output

and

lynx -source http://www.tiac.net/users/demas

would print the source code to std output

There are many other options.

man lynx

Is this what you had in mind?

Chuck Demas
Needham, Mass.

--
  Eat Healthy    |   _ _   | Nothing would be done at all,
  Stay Fit       |   @ @   | If a man waited to do it so well,
  Die Anyway     |    v    | That no one could find fault with it.
  de...@tiac.net |  \___/  | http://www.tiac.net/users/demas



 Tue, 17 Dec 2002 03:00:00 GMT   
 Make HTTP request from Unix shell script
Another good tool to try is 'netcat'.

On Fri, 30 Jun 2000 olb...@iname.com wrote:



 Fri, 24 Jan 2003 03:00:00 GMT   
 Make HTTP request from Unix shell script
In article <Pine.LNX.4.04.10008070230390.1882-100...@snoopy.peanuts>,
Cannon Fodder  <techn...@NOSPAMns.sympatico.ca> wrote:

Or lynx, a ubix text browser.

lynx -dump <url>

or

lynx -source <url>

man lynx

Chuck Demas
Needham, Mass.

--
  Eat Healthy    |   _ _   | Nothing would be done at all,
  Stay Fit       |   @ @   | If a man waited to do it so well,
  Die Anyway     |    v    | That no one could find fault with it.
  de...@tiac.net |  \___/  | http://www.tiac.net/users/demas



 Fri, 24 Jan 2003 03:00:00 GMT   
 
   [ 6 post ] 

Similar Threads

1. shell script to log http request

2. Issuing http request via bash shell script

3. Unix Shell Script Request

4. How to send http request whit shell programming?

5. Generating an HTTP Request From a Script?

6. Sending an HTTP GET request from Unix to IIS under NTLM

7. Apache Proxy server that will transform an HTTP request in a HTTPS request

8. Can't process http/1.0 requests or proxy requests

9. Performing HTTP Get on remote server within shell script

10. calling CGI scripts from UNIX shell scripts->html


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software