ezhttp

package
v0.0.0-...-2be0f72 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EzClient

type EzClient struct {
	*http.Client
	// contains filtered or unexported fields
}

EzClient is a container for the http requests.

func NewClient

func NewClient() *EzClient

NewClient creates a http connection.

func NewSSLClient

func NewSSLClient() *EzClient

NewSSLClient creates a new SSL client but skips verification.

func (*EzClient) FileGet

func (c *EzClient) FileGet(url, path string) (int, error)

FileGet downloads a file and writes it to path.

func (*EzClient) JSON

func (c *EzClient) JSON(j interface{}) *EzClient

JSON takes an object, marshals it and make it avaiable for POST and PUT.

func (*EzClient) JSONGet

func (c *EzClient) JSONGet(url string, out interface{}) (int, error)

JSONGet performs a get request and decodes the resulting JSON.

func (*EzClient) JSONPost

func (c *EzClient) JSONPost(url string, out interface{}) (int, error)

JSONPost performs a POST with JSON.

func (*EzClient) JSONStr

func (c *EzClient) JSONStr(j string) *EzClient

JSONStr takes a string formatted as JSON and makes it available for POST and PUT.

func (*EzClient) PostFile

func (c *EzClient) PostFile(url, filepath, formName string, params map[string]string) (int, error, string)

PostFile posts a whole file

func (*EzClient) PostFileBytes

func (c *EzClient) PostFileBytes(url, filepath, formName string, contents []byte, params map[string]string) (int, error, string)

PostFileBytes posts a range of bytes

Jump to

Keyboard shortcuts

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