HTTP: Difference between revisions

Content added Content deleted
(Undo revision 315437 by WdeCvfYlmB (talk))
(Undo revision 315436 by WdeCvfYlmB (talk))
Line 859: Line 859:
{{works with|GNU Forth|0.7.0}}
{{works with|GNU Forth|0.7.0}}
This works at the socket level, returning both the HTTP headers and page contents.
This works at the socket level, returning both the HTTP headers and page contents.
<lang forth>include unix/socket.fs
<lang forth>
s"www.w3.org" 80 open-socket
include unix/socket.fs

dup s\" GET /Home.html HTTP/1.0\n\n" rot write-socket
s" localhost" 80 open-socket
dup s\" GET / HTTP/1.0\n\n" rot write-socket
dup pad 8092 read-socket type
dup pad 8092 read-socket type
close-socket</lang>
close-socket
</lang>


=={{header|friendly interactive shell}}==
=={{header|friendly interactive shell}}==
{{trans|UNIX Shell}}
{{trans|UNIX Shell}}
<lang fishshell>curl -s -L http://rosettacode.org/</lang>
<lang fishshell>curl --silent --location http://www.w3.org/Home.html</lang>
<lang fishshell>lynx -source http://www.w3.org/Home.html</lang>

<lang fishshell>lynx -source http://rosettacode.org/</lang>
<lang fishshell>wget --output-document=- --quiet http://www.w3.org/Home.html</lang>
<lang fishshell>lftp -c "cat http://www.w3.org/Home.html"</lang>

<lang fishshell>wget -O - -q http://rosettacode.org/</lang>

<lang fishshell>lftp -c "cat http://rosettacode.org/"</lang>

{{works with|BSD}}
{{works with|BSD}}
<lang fishshell>ftp -o - http://rosettacode.org ^ /dev/null</lang>
<lang fishshell>ftp -o - http://rosettacode.org ^ /dev/null</lang>