httputil

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidReq = errors.New("rest consumer call arg is not *http.Request type")

ErrInvalidReq invalid input

Functions

func GetContentType

func GetContentType(req *http.Request) string

GetContentType is a method used for getting content-type in a request

func GetCookie

func GetCookie(req *http.Request, key string) string

GetCookie is a method which gets cookie from a request

func GetRespCookie

func GetRespCookie(resp *http.Response, key string) []byte

GetRespCookie returns response Cookie.

func ReadBody

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

ReadBody read body from the from the response

func SetBody

func SetBody(req *http.Request, body []byte)

SetBody is a method used for setting body for a request

func SetContentType

func SetContentType(req *http.Request, ct string)

SetContentType is a method used for setting content-type in a request

func SetCookie

func SetCookie(req *http.Request, k, v string)

SetCookie set key value in request cookie

func SetRespCookie

func SetRespCookie(resp *http.Response, cookie *http.Cookie)

SetRespCookie sets the cookie.

func SetURI

func SetURI(req *http.Request, url string)

SetURI sets host for the request. set http(s)://{domain}/xxx

Types

This section is empty.

Jump to

Keyboard shortcuts

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