Documentation ¶
Index ¶
- Constants
- func DoRequest(client *http.Client, req *http.Request) (resp *http.Response, body string, err error)
- func DoRequestBytes(client *http.Client, req *http.Request) (resp *http.Response, body []byte, err error)
- func DoRequestJsonDecode(client *http.Client, req *http.Request, res interface{}) (resp *http.Response, err error)
- func EncodeURIComponent(str string) string
- func Get(uri string) ([]byte, error)
- func GetWithJsonDecode(uri string, v interface{}) error
- func MakeCommonRequest(method string, uri string, contentType ContentType, body []byte) *http.Request
- func MakeCommonRequestJson(method string, uri string, data interface{}) *http.Request
- func MakeCommonRequestWithUserAgent(method string, uri string, contentType ContentType, userAgent string, ...) *http.Request
- func PostForm(uri string, postData url.Values) ([]byte, error)
- func PostFormJsonDecode(uri string, postData url.Values, v interface{}) error
- func PostJsonWithJsonDecode(uri string, data interface{}, out interface{}) (err error)
- type ContentType
Constants ¶
View Source
const (
UserAgent = "AdsBot-Google (+http://www.google.com/adsbot.html)"
)
Variables ¶
This section is empty.
Functions ¶
func DoRequestBytes ¶
func DoRequestJsonDecode ¶
func GetWithJsonDecode ¶
func MakeCommonRequest ¶
func MakeCommonRequestJson ¶
func PostFormJsonDecode ¶
func PostJsonWithJsonDecode ¶
PostJsonWithJsonDecode 发送HTTP请求输入输出参数都是json对象
Types ¶
type ContentType ¶
type ContentType string
const ( ContentTypeJson ContentType = "application/json; charset=utf-8" ContentTypeAll ContentType = "*/*; charset=utf-8" )
Click to show internal directories.
Click to hide internal directories.