A simple way to create http server?

I tried the method shown in this example but I couldn’t read the request body with this approach. I looked into std.http.Server but I don’t know how to use it. Can someone give me an example of a http server that logs the http request including the request body? I’m using zig version 0.13.0

The std.http test code contains usage examples.

First construct a server by calling std.http.Server.init
See how to handle the requests in the echo http server test code:


You might want to use Karl Seguin HTTP Server.
See also: Why not std.http.Server?

3 Likes

Thank you so much. I’m not looking into third party alternatives just yet, my current project is really small

1 Like