Documentation
¶
Index ¶
- Constants
- func Get(apiURL string, params url.Values) (resData string, e error)
- func OnGetJSON(url, params string) string
- func OnPostForm(url string, data url.Values) (body []byte)
- func OnPostJSON(url, jsonstr string) []byte
- func Post(apiURL string, params url.Values) (resData string, err error)
- func SendGet(url, params string, obj interface{}) bool
- func SendGetEx(url string, reponse interface{}) bool
- func SendGetWithTimeOut(apiUrl string, params url.Values, time_out int) (resData string, e error)
- func SendPost(requestBody interface{}, responseBody interface{}, url string) bool
- func SendPostWithTimeOut(apiUrl string, params url.Values, time_out int) (resData string, e error)
- func WriteJSON(w http.ResponseWriter, msg interface{})
Constants ¶
View Source
const (
CONN_TIME_OUT = time.Second * 2
)
Variables ¶
This section is empty.
Functions ¶
func OnPostForm ¶
OnPostForm form 方式发送post请求
func SendGetWithTimeOut ¶
* Get with TimeOut Code == 200 则返回,其他请打印错误 第三个参数设置超时 单位:秒 【0:则默认两秒】
func SendPostWithTimeOut ¶
* Post with TimeOut Code == 200 则返回,其他请打印错误 第三个参数设置超时 单位:秒 【0:则默认两秒】
func WriteJSON ¶
func WriteJSON(w http.ResponseWriter, msg interface{})
WriteJSON 像指定client 发送json 包 msg message.MessageBody
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.