A custom HTTP Parser that attempts to be compliant with some of HTTP Semantics defined as of RFC 9110. Furthermore the focus will be on HTTP/1.1 as per RFC 9112
This is built purely for educational purposes as to get a deeper understanding for how the HTTP protocol works underneath the hood.
- Body parsing
- Partially implemented. Support for text/plain
- Streaming
- Error handling
- Etc?
c, err := http.NewHttpClient(http.TcpDialContext("example.com:80"))
if err != nil {
slog.Error("Error while creating http client", "err", err)
return
}
resp, err := c.Get("/")
if err != nil {
slog.Error("Error calling GET on uri", "err", err)
return
}
slog.Info("Received response", "body", string(resp.Body))