body

package
v2.0.0-beta.2+incompat... Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2015 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package body allows for the replacement of message body on responses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Modifier

type Modifier struct {
	// contains filtered or unexported fields
}

Modifier substitutes the body on an HTTP response.

func NewModifier

func NewModifier(b []byte, contentType string) *Modifier

NewModifier constructs and returns a body.Modifier.

func (*Modifier) ModifyRequest

func (m *Modifier) ModifyRequest(req *http.Request) error

ModifyRequest sets the Content-Type header and overrides the request body.

func (*Modifier) ModifyResponse

func (m *Modifier) ModifyResponse(res *http.Response) error

ModifyResponse sets the Content-Type header and overrides the response body.

Jump to

Keyboard shortcuts

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