Skip to content

Commit 2602e6c

Browse files
committed
add simple code sample to readme
1 parent 53a18de commit 2602e6c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.rst

+19
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,25 @@ Documentation
2525

2626
Documentation is available at https://hpack.readthedocs.io .
2727

28+
Quickstart:
29+
30+
.. code-block:: python
31+
32+
from hpack import Encoder, Decoder
33+
34+
headers = [
35+
(':method', 'GET'),
36+
(':path', '/jimiscool/'),
37+
('X-Some-Header', 'some_value'),
38+
]
39+
40+
e = Encoder()
41+
encoded_bytes = e.encode(headers)
42+
43+
d = Decoder()
44+
decoded_headers = d.decode(encoded_bytes)
45+
46+
2847
Contributing
2948
============
3049

0 commit comments

Comments
 (0)