responder

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2015 License: MIT Imports: 4 Imported by: 2

Documentation

Overview

Helpers for generating common types of responses

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONResponse

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

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

A 302 redirect response

Types

This section is empty.

Jump to

Keyboard shortcuts

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