File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ The documentation is located at [http://hyperium.github.io/hyper](http://hyperiu
23
23
24
24
## Example
25
25
26
- Hello World Server:
26
+ ### Hello World Server:
27
27
28
28
``` rust
29
29
extern crate hyper;
@@ -36,17 +36,15 @@ use hyper::server::Response;
36
36
use hyper :: net :: Fresh ;
37
37
38
38
fn hello (_ : Request , res : Response <Fresh >) {
39
- let mut res = res . start (). unwrap ();
40
- res . write_all (b " Hello World!" ). unwrap ();
41
- res . end (). unwrap ();
39
+ res . send (b " Hello World!" ). unwrap ();
42
40
}
43
41
44
42
fn main () {
45
43
Server :: http (" 127.0.0.1:3000" ). unwrap (). handle (hello );
46
44
}
47
45
```
48
46
49
- Client:
47
+ ### Client:
50
48
51
49
``` rust
52
50
extern crate hyper;
@@ -61,7 +59,7 @@ fn main() {
61
59
let mut client = Client :: new ();
62
60
63
61
// Creating an outgoing request.
64
- let mut res = client . get (" http://www.gooogle.com /" )
62
+ let mut res = client . get (" http://rust-lang.org /" )
65
63
// set a header
66
64
. header (Connection :: close ())
67
65
// let 'er go!
You can’t perform that action at this time.
0 commit comments