httputil

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllHTTPMethods

func AllHTTPMethods() []string

AllHTTPMethods contains all available HTTP methods

func DrainResponseBody

func DrainResponseBody(resp *http.Response)

DrainResponseBody drains and closes the response body

func DumpRequest

func DumpRequest(req *http.Request) (string, error)

DumpRequest to string

func DumpResponseHeadersAndRaw

func DumpResponseHeadersAndRaw(resp *http.Response) (headers, fullresp []byte, err error)

DumpResponseHeadersAndRaw returns http headers and response as strings

Types

type ChainItem

type ChainItem struct {
	Request    []byte
	Response   []byte
	StatusCode int
	Location   string
	RequestURL string
}

ChainItem request=>response

func GetChain

func GetChain(r *http.Response) (chain []ChainItem, err error)

GetChain if redirects

Jump to

Keyboard shortcuts

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