http

package
v0.0.0-...-41c389d Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(uri string) ([]byte, error)

Get http get 请求

func PostFile

func PostFile(fieldName, fileName, uri string) ([]byte, error)

PostFile 上传文件

func PostFromURLEncoded

func PostFromURLEncoded(uri string, params url.Values) ([]byte, error)

PostFromURLEncoded .

func PostJSON

func PostJSON(uri string, obj interface{}) ([]byte, error)

PostJSON post json 数据请求

func PostMultipartForm

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

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

func PostXML

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

PostXML perform a HTTP/POST request with XML body

Types

type MultipartFormField

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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