httputil

package
v0.0.39 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: MIT Imports: 5 Imported by: 41 modules, 64 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

Jump to

Keyboard shortcuts

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