httpc - liangmanlin/gootp GitHub Wiki

基于net/http库封装的 http client

  • Get(url string, param map[string]interface{}, timeOut int32, urlEncode bool) (body []byte, ok bool) 发起一个 http get 请求,其中URLEncode 表示是否对param进行urlEncode。

  • GetSSL(url string, param map[string]interface{}, timeOut int32, urlEncode bool) (body []byte, ok bool) 发起一个https get 请求。

  • Post(url, data, contentType string, timeOut int32) (body []byte, ok bool) 发起一个 http post 请求,data 是请求体。

  • PostSSL(url, data, contentType string, timeOut int32) (body []byte, ok bool) 发起一个https post 请求。

  • StartWorker(father *kernel.Pid) *kernel.Pid

    如果你想自己管理worker,你可以通过这个启动一个worker进程。

    然后通过Request(pid *kernel.Pid, method, url, body, contentType string, timeOut int32, ssl bool) ([]byte, bool) 发起请求。