request

package
v0.0.0-...-3ead46a Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CatWebSite = "https://app.hbooker.com/"
View Source
var HappyWebSite = "https://app.happybooker.cn/"
View Source
var SFWebSite = "https://minipapi.sfacg.com/pas/mpapi/"

Functions

func Base64Bytes

func Base64Bytes(UserName, Password string) string

func Get

func Get(url string, structural any) any

func JsonUnmarshal

func JsonUnmarshal(response []byte, Struct any) any

func MustNewRequest

func MustNewRequest(method, url string, data io.Reader) *http.Request

func Request

func Request(url string) []byte

func SET_THE_HEADERS

func SET_THE_HEADERS(req *http.Request)

func SET_URL

func SET_URL(url string) string

Types

type Context

type Context struct {
	Url      string
	Params   string
	GetQuery []map[string]interface{}
	Structs  interface{}
}

func (*Context) AddCatToken

func (c *Context) AddCatToken()

func (*Context) Init

func (c *Context) Init(url string) *Context

func (*Context) Query

func (c *Context) Query(key string, value string) *Context

func (*Context) QueryToString

func (c *Context) QueryToString() string

type HttpUtils

type HttpUtils struct {
	// contains filtered or unexported fields
}

func NewHttpUtils

func NewHttpUtils(api_url, method string) *HttpUtils

func (*HttpUtils) Add

func (is *HttpUtils) Add(key string, value string) *HttpUtils

func (*HttpUtils) GetCookie

func (is *HttpUtils) GetCookie() []*http.Cookie

func (*HttpUtils) GetEncodeParams

func (is *HttpUtils) GetEncodeParams() *bytes.Reader

func (*HttpUtils) GetResultBody

func (is *HttpUtils) GetResultBody() string

func (*HttpUtils) GetUrl

func (is *HttpUtils) GetUrl() string

func (*HttpUtils) GetValue

func (is *HttpUtils) GetValue(key string) string

func (*HttpUtils) NEW_SET_THE_HEADERS

func (is *HttpUtils) NEW_SET_THE_HEADERS()

func (*HttpUtils) NewRequests

func (is *HttpUtils) NewRequests() *HttpUtils

func (*HttpUtils) Unmarshal

func (is *HttpUtils) Unmarshal(s any) *HttpUtils

Jump to

Keyboard shortcuts

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