diff samples/http.tp @ 157:55e0dca7d3d7

Partial implementation of HTTP get requests
author Mike Pavone <pavone@retrodev.com>
date Sat, 10 Aug 2013 15:06:56 -0700
parents 075b1e71feff
children
line wrap: on
line diff
--- a/samples/http.tp	Sat Aug 10 14:50:38 2013 -0700
+++ b/samples/http.tp	Sat Aug 10 15:06:56 2013 -0700
@@ -5,6 +5,13 @@
 			server <- args get: 1
 		}
 		cli <- http client: server
-		print: (string: (cli get: "/"))
+		resp <- (cli get: "/")
+		print: "Status: " . (resp status) . "\n"
+		print: "Code: " . (resp statusCode) . "\n"
+		print: "Headers:\n"
+		foreach: (resp headers) :key val {
+			print: key . " -> " . val . "\n"
+		}
+		print: "Body:\n" . (resp body) . "\n"
 	}
 }