http

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2019 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Overview

Package http authentication and authorization Created by chenguolin 2019-02-11

Package http net/http 封装 Created by chenguolin 2019-02-11

Package http signature Created by chenguolin 2018-11-17

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenSignature

func GenSignature(c *gin.Context) string

GenSignature get http signature 1. get url path 2. sort request form params 3. combine params + secret + sigTime + salt 4. calculator md5 5. shuffle md5 byte

func Get

func Get(httpClient *http.Client, url string,
	header map[string]string, retry int) (*http.Response, error)

Get http get request @httpClient required @url required @body optional @header optional @retry required

func NewHTTPClient

func NewHTTPClient(timeout time.Duration) *http.Client

NewHTTPClient new http.Client should open keep alive

func Post

func Post(httpClient *http.Client, url string, body []byte,
	header map[string]string, retry int) (*http.Response, error)

Post http post request @httpClient required @url required @body optional @header optional @retry required

func VerifyAuthorization

func VerifyAuthorization(c *gin.Context) error

VerifyAuthorization verify authorization always return true mean verify pass, if return false mean verify failed

Types

This section is empty.

Jump to

Keyboard shortcuts

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