Documentation ¶
Overview ¶
Package http http tools Author: Frank Lee Date: 2017-11-17 09:16:30 Last Modified by: Frank Lee Last Modified time: 2017-11-17 09:16:30
Index ¶
- func Get(url string) ([]byte, error)
- func GetInTime(url string, time *time.Duration) ([]byte, error)
- func GetInsecure(url string) ([]byte, error)
- func GetInsecureInTime(url string, time *time.Duration) ([]byte, error)
- func Post(url, params string, t ContentType) ([]byte, error)
- func PostInTime(url, params string, t ContentType, time *time.Duration) ([]byte, error)
- func PostInsecure(url, params string, t ContentType) ([]byte, error)
- func PostInsecureInTime(url, params string, t ContentType, time *time.Duration) ([]byte, error)
- type ContentType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetInTime ¶
GetInTime get timeout param url: url param time: timeout return []byte: http response body return error: errors
func GetInsecure ¶
GetInsecure https get insecurely with timeout param url: url return []byte: response body return error: errors
func GetInsecureInTime ¶
GetInsecureInTime https get insecurely with timeout param url: url param time: timeout return []byte: response body return error: errors
func Post ¶
func Post(url, params string, t ContentType) ([]byte, error)
Post post param url: url param params: params param t: content-type http.JSON/http.FORM return []byte: http response body return error: errors
func PostInTime ¶
PostInTime post timeout param url: url param params: params param t content-type http.JSON/http.FORM param time timeout return []byte: http response body return error: errors
func PostInsecure ¶
func PostInsecure(url, params string, t ContentType) ([]byte, error)
PostInsecure https post insecurely with timeout param url: url param params: params param t content-type http.JSON/http.FORM return []byte: http response body return error: errors
func PostInsecureInTime ¶
PostInsecureInTime https post insecurely with timeout param url: url param params: params param t content-type http.JSON/http.FORM param time: timeout return []byte: http response body return error: errors
Types ¶
type ContentType ¶
type ContentType int
ContentType content-type
const ( // JSON application/json JSON ContentType = 0 // FORM application/x-www-form-urlencoded FORM ContentType = 1 )