http

package
v0.0.0-...-3fc60fe Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Log *log.Log

Functions

func ClientPost

func ClientPost(c *http.Client, url, content string) ([]byte, error)

func Get

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

func HttpGet

func HttpGet(url string) string

func HttpPost

func HttpPost(url, postData string, params ...string) ([]byte, error)

func HttpsPost

func HttpsPost(url, postData string, params ...string) ([]byte, error)

func NewHttpsClient

func NewHttpsClient(certs tls.Certificate) *http.Client

func Post

func Post(url, postData string, params ...string) ([]byte, error)

Types

type Values

type Values map[string]string

Values maps a string key to a list of values. It is typically used for query parameters and form values. Unlike in the http.Header map, the keys in a Values map are case-sensitive.

func (Values) Add

func (v Values) Add(key, value string)

Set sets the key to value. It replaces any existing values.

func (Values) Data

func (v Values) Data() []byte

func (Values) Del

func (v Values) Del(key string)

Del deletes the values associated with key.

func (Values) Encode

func (v Values) Encode() string

Encode encodes the values into “URL encoded” form ("bar=baz&foo=quux") sorted by key.

func (Values) Get

func (v Values) Get(key string) string

Get gets the first value associated with the given key. If there are no values associated with the key, Get returns the empty string. To access multiple values, use the map directly.

func (Values) GetSignData

func (v Values) GetSignData() string

获取需要签名的数据

func (Values) GetSignDataNoSpace

func (v Values) GetSignDataNoSpace() string

获取需要签名的数据 空值键值对不参与签名

func (Values) Set

func (v Values) Set(key, value string)

Set sets the key to value. It replaces any existing values.

func (Values) ToString

func (v Values) ToString() string

返回json格式

Jump to

Keyboard shortcuts

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