httputils

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HTTPGet              = "GET"
	HTTPPost             = "POST"
	HTTPDelete           = "DELETE"
	HTTPPut              = "PUT"
	HeaderContentType    = "Content-Type"
	HeaderAuthentication = "Authentication"
	HeaderSignature      = "Signature"
	HeaderTimestamp      = "Timestamp"
	ContentTypeJSON      = "application/json"
	ContentTypeForm      = "application/x-www-form-urlencoded; param=value"
)

Variables

This section is empty.

Functions

func ParseURL

func ParseURL(s string, m map[string]string) string

Types

type Authentication

type Authentication struct {
	Key    string `json:"key"`
	Secret string `json:"secret"`
}

type RestClient

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

func NewRestClientWithAuthentication

func NewRestClientWithAuthentication(auth *Authentication) *RestClient

func NewRestClientWithBasicAuth

func NewRestClientWithBasicAuth(user, password string) *RestClient

func (*RestClient) Delete

func (c *RestClient) Delete(uri string) ([]byte, error)

func (*RestClient) Get

func (c *RestClient) Get(uri string) ([]byte, error)

func (*RestClient) Post

func (c *RestClient) Post(uri string, data []byte) ([]byte, error)

func (*RestClient) Put

func (c *RestClient) Put(uri string, data []byte) ([]byte, error)

func (*RestClient) SetHeader

func (c *RestClient) SetHeader(key, value string)

Jump to

Keyboard shortcuts

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