httputils

package
v0.0.89 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2022 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCookie

func CreateCookie(name, value, domain, path string, maxage int, httpOnly bool) (*http.Cookie, error)

CreateCookie is delegated to initialize and set a cookie with the given value

func DebugRequest

func DebugRequest(ip, port, endpoint string) error

DebugRequest is delegated to print the request data for debug purpouse

func ReadBody added in v0.0.76

func ReadBody(resp *http.Response) ([]byte, error)

func ServeCookie

func ServeCookie(ip, port, endpoint, name, value, domain, path string, maxage int, httpOnly bool) error

ServeCookie is delegated to set a cookie and shutdown the server after the first call

func ServeHeaders added in v0.0.8

func ServeHeaders(headersList []string, ip, port, endpoint string) error

ServeHeaders is delegated to spawn a webserver for set the input headers into the (request) response

func SetHeaders added in v0.0.8

func SetHeaders(headersList []string, w http.ResponseWriter) error

SetHeaders is delegated to set the given (key-value) headers list into the response

func ValidatePort added in v0.0.29

func ValidatePort(port int) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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