httputils

package
v0.0.0-...-53094e6 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MulanPSL-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServerIsHttp

func ServerIsHttp(rawurl string) (bool, error)

Types

type Params

type Params struct {
	// Header 参数会被添加到请求header当中
	Header map[string]string
	// Form 参数会被格式化到url当中
	Form map[string]string
	// Body 参数会被序列化成json字符串
	Body interface{}
	// Cookit 参数会被添加到请求cookie当中
	Cookie map[string]string
}

type Response

type Response struct {
	// 返回状态码
	StatusCode int
	// 返回body数组,[]byte
	Body []byte
}

func Delete

func Delete(url string, params *Params) (*Response, error)

func Get

func Get(url string, params *Params) (*Response, error)

func Post

func Post(url string, params *Params) (*Response, error)

func Put

func Put(url string, params *Params) (*Response, error)

Jump to

Keyboard shortcuts

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