Documentation ¶
Index ¶
- func OnGetJSON(url, params string) string
- func OnPostForm(url string, data url.Values) (body []byte)
- func OnPostJSON(url, jsonstr string) ([]byte, error)
- func PostFile(filename, fieldname, targetURL string) (result string, e error)
- func PostHeader(url, jsonstr string, header http.Header) ([]byte, error)
- func SendGet(url, params string, obj interface{}) bool
- func SendGetEx(url string, reponse interface{}) bool
- func SendPost(requestBody interface{}, responseBody interface{}, url string) error
- func UploadMoreFile(r *http.Request, dir string) (result bool, optionDirs []string)
- func WriteJSON(w http.ResponseWriter, msg interface{})
- type MyHttpClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OnPostForm ¶
OnPostForm form 方式发送post请求
func PostHeader ¶
PostHeader post by head
func UploadMoreFile ¶
UploadMoreFile 多文件上传,dir:空则使用文件后缀做dir
func WriteJSON ¶
func WriteJSON(w http.ResponseWriter, msg interface{})
WriteJSON 像指定client 发送json 包 msg message.MessageBody
Types ¶
type MyHttpClient ¶
type MyHttpClient struct {
// contains filtered or unexported fields
}
func (*MyHttpClient) GetClient ¶
func (c *MyHttpClient) GetClient() *http.Client
Click to show internal directories.
Click to hide internal directories.