Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

Reply GoDoc Build Status Go Version Go Report Card

  • Easy to write and read
  • JSON mode enabled by default
    • Sets Content-Type to be application/json
    • uses json.NewDecoder(w).Encode(data)
  • Simplifies status code responses

Usage

type User struct {
  ID string `json:"id"`
  Name string `json:"name"`
}

func CreateUserHandler(w http.ResponseWriter, r *http.Request) {
  u := &User{ID: "123", Name: "Felix"}
  reply.Created(w, u)
}

About

Small utility function to easily set status codes to `http.ResponseWriters` 👨‍💻

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages