From 53f5e2f6859e6aa0c579fff4bf01d054507c8d7b Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 10 Jan 2013 16:50:48 -0800 Subject: Checkpoint: HTTP client (needs a buffered stream badly). --- curl.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 curl.py (limited to 'curl.py') diff --git a/curl.py b/curl.py new file mode 100755 index 0000000..127616a --- /dev/null +++ b/curl.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 + +import sys + +import tulip +from tulip import http_client + + +def main(): + url = sys.argv[1] + p = http_client.HttpClientProtocol(url) + f = p.connect() + t = p.event_loop.run_until_complete(tulip.Task(f)) + print('transport =', t) + p.event_loop.run() + + +if __name__ == '__main__': + main() -- cgit v1.2.1