Testing the RESTful Server
Let’s learn how to test a RESTful server.
This lesson shows how to test the RESTful server using the curl(1)
utility. We should test the RESTful server as much and as extensively as possible to find bugs or unwanted behavior. As we use two files for the server implementation, we need to run it as go run main.go handlers.go
. Additionally, do not forget to have PostgreSQL up and running. We begin by testing the /time
handler, which works with all HTTP methods:
Get hands-on with 1400+ tech skills courses.