inko-lang / inko

A language for building concurrent software with confidence
http://inko-lang.org/
Mozilla Public License 2.0
895 stars 41 forks source link

Add standard library support for HTTP 1.1, HTTP 2.0 and HTTP 3 #734

Open yorickpeterse opened 3 months ago

yorickpeterse commented 3 months ago

Description

The standard library should provide an HTTP client that supports HTTP 1.1, 2.0, and 3/QUIC. The client would be provided by the module std.net.http and should transparently support the correct HTTP version. For HTTP 1.1, chunked transfers must be supported.

To make testing easier, it might be worth considering implementing the library such that the code performing the actual requests can be swapped out. This is something I did for Openflow, though I'm not super happy with the exact setup it uses.

In terms of the design of the client/API interface, I'm not sure just yet so we'll need to do some experimenting.

Priorities

HTTP 1.1 and 2.0 have a higher priority compared to HTTP 3, as adoption of HTTP 3 is still pretty limited. The HTTP 3 protocol is also significantly different, and likely requires changes to the runtime library to support QUIC sockets (I think?).

Resources

Related work

No response

yorickpeterse commented 3 months ago

It's worth thinking about whether HTTP 2 support is actually beneficial. Much of the web still uses or at least supports HTTP 1.1, and HTTP 3 fixes issues present in both 1.1 and 2.0 (e.g. head of line blocking). We could decide to just skip HTTP 2 in favour of only supporting 1.1 and 3.0.