gin_tutorial

command module
v0.0.0-...-3b34607 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

README

Gin Tutorial

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/

Curl Commands

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"

Submit and handle JSON

curl -X POST http://localhost:8080/robin -H "Accept: application/json" -H "Content-Type: application/json" --data '{"url":"test.com"}'

Testing

To test everything:

go test -v

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL