futursolo / magichttp

Asynchronous http, made easy.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make initial fields unicode

futursolo opened this issue · comments

Originally, initial fields(path, headers, etc.) is processed as bytes objects to avoid unnecessary decoding.

However, this has some drawbacks:

  • Users have to encode headers before passing them into the library.
  • HTTP2 uses unicode headers, so this is not good for potential h2 support in the future.
  • The difference between bytes and str can be confusing for non-experienced Pythonistas.

Hence, I've decided to change the initial fields to str.