body

package
Version: v2.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2018 License: Apache-2.0 Imports: 13 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.

func (*Modifier) SetBoundary

func (m *Modifier) SetBoundary(boundary string)

SetBoundary set the boundary string used for multipart range responses.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL