httpdump

package
v0.0.0-...-b14404a Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidDumpFormat = errors.New("invalid http dump format")

Functions

func DumpHTTP

func DumpHTTP(w *http.Response, r *http.Request) ([]byte, error)

func DumpRequest

func DumpRequest(r *http.Request) ([]byte, error)

func DumpResponse

func DumpResponse(r *http.Response) ([]byte, error)

func ReadHTTP

func ReadHTTP(b []byte) (w *http.Response, r *http.Request, err error)

func ReadRequest

func ReadRequest(b []byte) (*http.Request, error)

func ReadResponse

func ReadResponse(b []byte) (*http.Response, error)

Types

type Dump

type Dump struct {
	Line    string      `json:"line"`
	Header  http.Header `json:"header"`
	Body    any         `json:"body"`
	Trailer http.Header `json:"trailer"`
}

func FromRequest

func FromRequest(r *http.Request) (*Dump, error)

func FromResponse

func FromResponse(r *http.Response) (*Dump, error)

Jump to

Keyboard shortcuts

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