Help us shape the future of Go! Take the 2026 Go Developer Survey

httputil

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: MIT Imports: 4 Imported by: 0

README

httputil

The package contains various helpers related to http protocol

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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