Fetch

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EasyJson

func EasyJson(endpoint string, reqData EasyJsonSerialization, respData EasyJsonSerialization, options ...Option) error

EasyJson 使用easyJson接口的json请求与响应

func Json

func Json(endpoint string, reqData any, respData any, options ...Option) error

Json json请求与响应

func SetHostOption

func SetHostOption(req *fasthttp.Request)

SetHostOption 设置host头

func Text

func Text(endpoint string, reqData string, options ...Option) (string, error)

Text text请求与响应

func UseCompressOption

func UseCompressOption(req *fasthttp.Request)

UseCompressOption 设置请求优先使用压缩

func UseGetOption

func UseGetOption(req *fasthttp.Request)

UseGetOption 设置GET请求

Types

type EasyJsonSerialization

type EasyJsonSerialization interface {
	MarshalJSON() ([]byte, error)
	UnmarshalJSON(data []byte) error
}

type Option

type Option func(req *fasthttp.Request)

Jump to

Keyboard shortcuts

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