Another update from ingydotnet^djgoku
This commit is contained in:
parent
91df62d461
commit
948b86eafa
7604 changed files with 108452 additions and 22726 deletions
20
Task/HTTP/AWK/http.awk
Normal file
20
Task/HTTP/AWK/http.awk
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
BEGIN {
|
||||
site="en.wikipedia.org"
|
||||
path="/wiki/"
|
||||
name="Rosetta_Code"
|
||||
|
||||
server = "/inet/tcp/0/" site "/80"
|
||||
print "GET " path name " HTTP/1.0" |& server
|
||||
print "Host: " site |& server
|
||||
print "\r\n\r\n" |& server
|
||||
|
||||
while ( (server |& getline fish) > 0 ) {
|
||||
if ( ++scale == 1 )
|
||||
ship = fish
|
||||
else
|
||||
ship = ship "\n" fish
|
||||
}
|
||||
close(server)
|
||||
|
||||
print ship
|
||||
}
|
||||
6
Task/HTTP/Emacs-Lisp/http.l
Normal file
6
Task/HTTP/Emacs-Lisp/http.l
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
(with-current-buffer
|
||||
(url-retrieve-synchronously "http://www.rosettacode.org")
|
||||
(goto-char (point-min))
|
||||
(search-forward "\n\n" nil t) ;; skip headers
|
||||
(prin1 (buffer-substring (point) (point-max)))
|
||||
(kill-buffer (current-buffer)))
|
||||
|
|
@ -1 +1,2 @@
|
|||
require'web/gethttp'
|
||||
gethttp 'http://www.rosettacode.org'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* NetRexx */
|
||||
options replace format comments java crossref savelog symbols binary
|
||||
options replace format comments java crossref symbols binary
|
||||
|
||||
import java.util.Scanner
|
||||
import java.net.URL
|
||||
|
|
|
|||
|
|
@ -2,6 +2,6 @@ use v6;
|
|||
|
||||
my $socket = IO::Socket::INET.new(host => "www.rosettacode.org",
|
||||
port => 80,);
|
||||
$socket.send("GET / HTTP/1.0\r\n\r\n");
|
||||
$socket.print("GET / HTTP/1.0\r\n\r\n");
|
||||
print $socket.recv();
|
||||
$socket.close;
|
||||
|
|
|
|||
2
Task/HTTP/Rust/http-1.rust
Normal file
2
Task/HTTP/Rust/http-1.rust
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
[dependencdies]
|
||||
hyper = "0.6"
|
||||
12
Task/HTTP/Rust/http-2.rust
Normal file
12
Task/HTTP/Rust/http-2.rust
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
extern crate hyper;
|
||||
|
||||
use std::io::Read;
|
||||
use hyper::client::Client;
|
||||
|
||||
fn main() {
|
||||
let client = Client::new();
|
||||
let mut resp = client.get("http://rosettacode.org").send().unwrap();
|
||||
let mut body = String::new();
|
||||
resp.read_to_string(&mut body).unwrap();
|
||||
println!("{}", body);
|
||||
}
|
||||
4
Task/HTTP/Scheme/http-2.ss
Normal file
4
Task/HTTP/Scheme/http-2.ss
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
(use http-client)
|
||||
(print
|
||||
(with-input-from-request "http://google.com/"
|
||||
#f read-string))
|
||||
Loading…
Add table
Add a link
Reference in a new issue