Skip to content

Commit

Permalink
add simple code sample to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Kriechi committed Dec 20, 2024
1 parent 53a18de commit 2602e6c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,25 @@ Documentation

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

Quickstart:

.. code-block:: python
from hpack import Encoder, Decoder
headers = [
(':method', 'GET'),
(':path', '/jimiscool/'),
('X-Some-Header', 'some_value'),
]
e = Encoder()
encoded_bytes = e.encode(headers)
d = Decoder()
decoded_headers = d.decode(encoded_bytes)
Contributing
============

Expand Down

0 comments on commit 2602e6c

Please sign in to comment.