• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.travis.ymlH A D31-May-2018272 1612

LICENSEH A D31-May-20181.1 KiB2116

README.mdH A D31-May-20181.1 KiB2517

content_type.goH A D31-May-20182.1 KiB8567

decoder.goH A D31-May-20181.2 KiB4530

render.goH A D31-May-20183 KiB144101

responder.goH A D31-May-20186.6 KiB235171

README.md

1# render
2
3The `render` package helps manage HTTP request / response payloads.
4
5Every well-designed, robust and maintainable Web Service / REST API also needs
6well-*defined* request and response payloads. Together with the endpoint handlers,
7the request and response payloads make up the contract between your server and the
8clients calling on it.
9
10Typically in a REST API application, you will have your data models (objects/structs)
11that hold lower-level runtime application state, and at times you need to assemble,
12decorate, hide or transform the representation before responding to a client. That
13server output (response payload) structure, is also likely the input structure to
14another handler on the server.
15
16This is where `render` comes in - offering a few simple helpers and interfaces to
17provide a simple pattern for managing payload encoding and decoding.
18
19We've also combined it with some helpers for responding to content types and parsing
20request bodies. Please have a look at the [rest](https://github.com/go-chi/chi/blob/master/_examples/rest/main.go)
21example which uses the latest chi/render sub-pkg.
22
23All feedback is welcome, thank you!
24
25