Following this tutorial.
It's GitHub page.
Another one to look at. https://blog.logrocket.com/how-to-build-a-rest-api-with-golang-using-gin-and-gorm/
Get the API version:
curl -H "Accept: application/json" http://localhost:8080/api/ver
Now needs keys:
curl -X POST --data "apiKey=123" -H "apiKey: 123" http://localhost:8080/api/ver -H "Accept: application/json"
curl -X POST http://localhost:8080/robin -H "Accept: application/json" -H "Content-Type: application/json" --data '{"url":"test.com"}'
To test everything:
go test -v