http

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HttpGet

func HttpGet(url string) ([]byte, error)

HttpGet get request

func HttpPost

func HttpPost(url string, data string) ([]byte, error)

HttpPost post request

func PostFile

func PostFile(fieldname, filename, url string) ([]byte, error)

PostFile 上传文件

func PostJson

func PostJson(url string, obj interface{}) ([]byte, error)

PostJson post json request

func PostJsonWithRespContentType

func PostJsonWithRespContentType(url string, obj interface{}) ([]byte, string, error)

PostJsonWithRespContentType post json request return:Content-Type + Body

func PostMultipartForm

func PostMultipartForm(fields []MultipartFormField, url string) (respBody []byte, err error)

PostMultipartForm 上传文件或其他多个字段

func PostXML

func PostXML(url string, obj interface{}) ([]byte, error)

PostXML perform a HTTP/POST request with XML body

func PostXMLWithTLS

func PostXMLWithTLS(url string, obj interface{}, ca, key string) ([]byte, error)

PostXMLWithTLS perform a HTTP/POST request with XML body and TLS

Types

type MultipartFormField

type MultipartFormField struct {
	IsFile    bool
	FieldName string
	Value     []byte
	Filename  string
}

MultipartFormField 保存文件或其他字段信息

Jump to

Keyboard shortcuts

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