package body

import "github.com/google/martian/v3/body"

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

Index

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.

Source Files

body_modifier.go

Version
v3.1.0
Published
Feb 24, 2020
Platform
windows/amd64
Imports
13 packages
Last checked
1 hour ago

Tools for package owners.