httpget

package
v0.0.0-...-c5adc74 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HttpGET = HttpGet{DefaultTimeout: 1800}

HttpGET HttpGet的实例化

Functions

This section is empty.

Types

type HttpGet

type HttpGet struct {
	Timeout        int64 //预期请求超时时间
	DefaultTimeout int64 //默认请求超时时间
}

HttpGet HttpGET请求对象

func (*HttpGet) GetResponse

func (h *HttpGet) GetResponse(url string) (Response, error)

@title GetResponse @description 获取GET请求的响应结果 @param url string "需要请求的URL" @return res Response "请求结果" @return err error "包含的错误信息"

type Response

type Response struct {
	Url           string         //请求URL
	UseTime       int64          //请求用时(ms)
	TransportSize int64          //传输内容大小(byte)
	IsTimeOut     bool           //是否超出预期时间
	HttpResponse  *http.Response //原始响应
}

Response HttpGET响应结果

Jump to

Keyboard shortcuts

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