hnhttp

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	HTTP *http.Client
}

Client expl

func NewClient

func NewClient(certificates ...string) (*Client, error)

NewClient expl

func (Client) Do

func (client Client) Do(req *http.Request, dst ...interface{}) error

Do is a wrapper around http.do that error checks and decodes the response. dst is an optional destination pointer that must be either implementing io.writer or a struct to be populated by JSON data as dst is a variadic argument, multiple dst may be passed, however any additional destinations are ignored with no error.

func (Client) Get

func (client Client) Get(url string, dst ...interface{}) error

Get expl

func (Client) PostForm

func (client Client) PostForm(url string, data map[string][]string, dst ...interface{}) error

PostForm is a wrapper around http.PostForm that takes multiple kinds of input, and makes error checks and decodes the response. src is the source struct or map dst is an optional destination pointer that must be either implementing io.writer or a struct to be populated by JSON data as dst is a variadic argument, multiple dst may be passed, however any additional destinations are ignored with no error.

Jump to

Keyboard shortcuts

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