An open API service indexing awesome lists of open source software.

https://github.com/billsjc/go-http-study

a sample to use net/http package in golang
https://github.com/billsjc/go-http-study

Last synced: 3 months ago
JSON representation

a sample to use net/http package in golang

Awesome Lists containing this project

README

        

# go-http-study

Some sample of package `net/http`

## Requirement

- Go:`1.11+`

Recommend:

- Go:`1.12.4 or higner`
- IDE:`GoLand`
- CGO:`Disabled`

## Index

### Quick start

a base use of package http

### Get UA

try to get User-agent(a kind of header in HTTP Request header)

and now , u should use some methods(`recover`)to keep your service up

### Return time

a sample show you how to return a JSON object include time info

### Gin start

a sample show the init of gin framework

more details, please view gin\`s doc [gin-gonic/gin](https://github.com/gin-gonic/gin) or [godoc](https://godoc.org/github.com/gin-gonic/gin)