normalRequest

package
v0.0.0-...-34171ca Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64

func Base64(fileName string) string

图片文件传base64

func ParseJson

func ParseJson(req string) (map[string]interface{}, error)

解析json

Types

type NormalReq

type NormalReq struct {
	// contains filtered or unexported fields
}

func NormalRequest

func NormalRequest(reqUrl string) *NormalReq

通用请求

func ShowapiRequest

func ShowapiRequest(reqUrl string, appid int, sign string) *NormalReq

用于请求官网

func (*NormalReq) AddFilePara

func (request *NormalReq) AddFilePara(key, fileName string)

func (*NormalReq) AddHeadPara

func (request *NormalReq) AddHeadPara(key, value string)

func (*NormalReq) AddTextPara

func (request *NormalReq) AddTextPara(key, value string)

func (*NormalReq) Get

func (request *NormalReq) Get() (string, error)

get请求

func (*NormalReq) Post

func (request *NormalReq) Post() (string, error)

post请求包括文件上传部分

func (*NormalReq) SetConnectTimeOut

func (request *NormalReq) SetConnectTimeOut(connectTimeOut time.Duration)

func (*NormalReq) SetReadTimeOut

func (request *NormalReq) SetReadTimeOut(readTimeOut time.Duration)

Jump to

Keyboard shortcuts

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