httputil

package
v0.0.0-...-55524bd Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllowMethod

func AllowMethod(expect string, got string) bool

AllowMethod check if http method of request is allow

func BindBody

func BindBody(c *gin.Context, d interface{}) error

BindBody bind gin body

func BodyToQuery

func BodyToQuery(data string) string

BodyToQuery convert a JSON body to http GET query parameter

func GetRequestArgs

func GetRequestArgs(c *gin.Context, d interface{}) error

GetRequestArgs get request args

func HTTPRequest

func HTTPRequest(reqURL, method, data string, header http.Header, owner string) (string, *http.Response, error)

HTTPRequest implements general http request methods, and return the response string body BUG: return (string, http.Header, error) run fail

func IsQueryMethod

func IsQueryMethod(method string) bool

IsQueryMethod check if http method is query

func MakeRefer

func MakeRefer(req *http.Request) string

MakeRefer get refer from request

func ObjectBodyToQuery

func ObjectBodyToQuery(d interface{}) string

ObjectBodyToQuery convert a JSON body to http GET query parameter

func QueryToBody

func QueryToBody(query url.Values, pretty bool) string

QueryToBody convert query to body json

Types

This section is empty.

Jump to

Keyboard shortcuts

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