requestKit

package
v3.0.85 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(url string, queryParams map[string]interface{}) (statusCode int, data []byte, err error)

Get

TODO: 会不会重试?

func NewClient

func NewClient(debug bool, timeout time.Duration) (client *req.Client)

NewClient

重用 Client

https://req.cool/zh/docs/tutorial/best-practices/#%e9%87%8d%e7%94%a8-client

PS: (1) 不要每次发请求都创建 Client,造成不必要的开销,通常可以复用同一 Client 发所有请求.

func NewRequest

func NewRequest(client *req.Client) (r *req.Request)

NewRequest

@param client 可以为nil,将采用 defClient

func SimpleGet

func SimpleGet(url string) (statusCode int, data []byte, err error)

SimpleGet

TODO: 会不会重试?

Types

This section is empty.

Jump to

Keyboard shortcuts

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