falcore: github.com/fitstar/falcore/responder Index | Files

package responder

import "github.com/fitstar/falcore/responder"

Helpers for generating common types of responses


Package Files

doc.go json.go util.go

func JSONResponse Uses

func JSONResponse(req *http.Request, status int, headers http.Header, body interface{}) (*http.Response, error)

Generate an http.Response by json encoding body using the standard library's json.Encoder. error will be nil unless json encoding fails.

func RedirectResponse Uses

func RedirectResponse(req *http.Request, url string) *http.Response

A 302 redirect response

Package responder imports 4 packages (graph). Updated 2016-07-16. Refresh now. Tools for package owners.