ezhttp

package
v0.0.0-...-c063610 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2015 License: Apache-2.0 Imports: 11 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 NewInsecureClient

func NewInsecureClient() *EzClient

NewInsecureClient 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)

PostFile uploads a file.

Jump to

Keyboard shortcuts

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