Make a web request, cat response to stdout?

1

I'm working from the command line. I need to cat the response of a web request. What tool can I use to make the web request and print the response on stdout?

Here's the command I'm trying to make work:

$ wget http://crl.comodoca.com/COMODORSADomainValidationSecureServerCA.crl | \
       openssl crl -text -noout

I also tried netcat, but it resulted in a name lookup failure (with and without the http).

jww

Posted 2014-08-25T11:32:16.793

Reputation: 1

Answers

4

Use curl. It will output the content of the page on stdout:

mtak@frisbee:~$ curl www.google.com
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="http://www.google.nl/?gfe_rd=cr&amp;ei=QB_7U9XRNMqyOpX6gPAJ">here</A>.
</BODY></HTML>

mtak

Posted 2014-08-25T11:32:16.793

Reputation: 11 805

You're welcome, please mark this as a valid answer so other people can quickly see that this solved your problem. – mtak – 2014-08-25T11:41:19.850

1

This could be done also with wget:

wget -O - http://crl.comodoca.com/COMODORSADomainValidationSecureServerCA.crl

tonioc

Posted 2014-08-25T11:32:16.793

Reputation: 787