Documentation
¶
Index ¶
- Variables
- func Get(client *http.Client, url string) ([]byte, error)
- func GetWithObj(client *http.Client, url string, encoder serialize.Codec, obj interface{}) error
- func Post(client *http.Client, url string, contentType string, body io.Reader) ([]byte, error)
- func PostWithObj(client *http.Client, url string, contentType string, body io.Reader, ...) error
- type TLSClient
- func (h *TLSClient) Get(url string) ([]byte, error)
- func (h *TLSClient) GetWithObj(url string, obj interface{}) error
- func (h *TLSClient) ListenAndServeTLS(serverCrt, serverKey string) error
- func (h *TLSClient) Post(url, contentType string, body io.Reader) ([]byte, error)
- func (h *TLSClient) PostWithObj(url, contentType string, body io.Reader, obj interface{}) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidUrl = errors.New("url must start with 'http'") ErrInvalidEncoder = errors.New("invalid encoder") )
Functions ¶
func GetWithObj ¶
GetWithObj 发起get请求,并将结果反序列化到指定obj中
Types ¶
type TLSClient ¶
type TLSClient struct {
// contains filtered or unexported fields
}
func NewTLSClient ¶
NewTLSClient 创建TLS客户端
func (*TLSClient) GetWithObj ¶
GetWithObj GET并反序列化
func (*TLSClient) ListenAndServeTLS ¶
ListenAndServeTLS start
Click to show internal directories.
Click to hide internal directories.