aboutsummaryrefslogtreecommitdiffstats
path: root/test/h2/example.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/h2/example.py')
-rw-r--r--test/h2/example.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/h2/example.py b/test/h2/example.py
new file mode 100644
index 00000000..fc4f2f10
--- /dev/null
+++ b/test/h2/example.py
@@ -0,0 +1,18 @@
+from netlib.h2.frame import *
+from netlib.h2.h2 import *
+
+c = H2Client(("127.0.0.1", 443))
+c.connect()
+
+c.send_frame(HeadersFrame(
+ flags=(Frame.FLAG_END_HEADERS | Frame.FLAG_END_STREAM),
+ stream_id=0x1,
+ headers=[
+ (b':method', 'GET'),
+ (b':path', b'/index.html'),
+ (b':scheme', b'https'),
+ (b':authority', b'localhost'),
+ ]))
+
+while True:
+ print c.read_frame().human_readable()