helper

package
v0.0.0-...-e0ca84f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2016 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIGet

func APIGet(URL string) (string, *apiResp.ErrorResp)

APIGet : API中get请求返回string的helper方法

func APIPost

func APIPost(URL string, paramBody string) (string, *apiResp.ErrorResp)

APIPost : API中post请求返回string的helper方法

func APIPostMultiPart

func APIPostMultiPart(req *http.Request) (string, *apiResp.ErrorResp)

APIPostMultiPart : 带上传文件的post请求

func BuildGetQuery

func BuildGetQuery(param interface{}, URL string, accessToken string) string

BuildGetQuery : 构建查询参数,已经进行URL encode了的.

func BuildPostMultiPartQuery

func BuildPostMultiPartQuery(param interface{}, URL string, accessToken string, fieldName string, file *os.File) (*http.Request, error)

BuildPostMultiPartQuery : 构建上传文件的请求,返回的是 request 对象

func BuildPostQuery

func BuildPostQuery(param interface{}, accessToken string) string

BuildPostQuery : 构建Post请求,返回的是 name=Ava&friend=Jess&friend=Sarah&friend=Zoe 类似这样子的格式

func SetDefaultValues

func SetDefaultValues(param interface{})

SetDefaultValues : 设置参数默认值

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL