Mercurial > repos > tabletprog
comparison modules/http.tp @ 149:7f442b3e4448
Tiny bit of work on HTTP client and sample usage of it
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Fri, 09 Aug 2013 05:28:35 -0700 |
parents | |
children | 075b1e71feff |
comparison
equal
deleted
inserted
replaced
148:5071d601fe70 | 149:7f442b3e4448 |
---|---|
1 #{ | |
2 client:usingPort <- :address :port{ | |
3 #{ | |
4 get <- :path { | |
5 sock <- socket connectTo: address onPort: port | |
6 sock send: "GET " . path . " HTTP/1.1\r\nHost: " . address . "\r\n\r\n" | |
7 resp <- sock recv 4096 | |
8 print: resp | |
9 sock close | |
10 } | |
11 } | |
12 } | |
13 | |
14 client <- :address { | |
15 client: address usingPort: 80 | |
16 } | |
17 } |