Documentation ¶
Index ¶
- Constants
- func GetHttpRequest() *resty.Request
- func HttpClient(method string, url string, payload io.Reader, token string) ([]byte, error)
- func HttpClientStatusCode(method string, url string, payload io.Reader, token string) (int, error)
- func HttpClientWithBodyAndCode(method string, url string, payload io.Reader, token string) (int, []byte, error)
- func HttpClientWithQueries[T any](method string, url string, payload io.Reader, token string, param T) ([]byte, error)
- func HttpClientWithScreen(method string, url string, payload io.Reader) (int, []byte, error)
- func HttpGet(method string, url string) ([]byte, error)
- func HttpPost(url string, data interface{}) (content string, err error)
- func NewHttpsClient() *resty.Client
Constants ¶
View Source
const ( GET = "GET" PUT = "PUT" POST = "POST" DELETE = "DELETE" )
View Source
const ( ContentType = "Content-Type" ApplicationJson = "application/json" ApplicationFromUrlencoded = "application/x-www-from-urlencoded" )
Variables ¶
This section is empty.
Functions ¶
func GetHttpRequest ¶
func GetHttpRequest() *resty.Request
func HttpClient ¶
func HttpClientStatusCode ¶
func HttpClientWithQueries ¶
func HttpClientWithScreen ¶
func HttpPost ¶
发送POST请求 url:请求地址,data:POST请求提交的数据,contentType:请求体格式,如:application/json content:请求放回的内容
func NewHttpsClient ¶
func NewHttpsClient() *resty.Client
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.