http

package
v0.0.0-...-f2091f6 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2015 License: BSD-2-Clause Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetDriver

func SetDriver(drv Driver)

Types

type Driver

type Driver interface {
	Do(*Request) (*Response, error)
}
type Header map[string][]string

func (Header) Add

func (h Header) Add(key, value string)

Add adds the key, value pair to the header. It appends to any existing values associated with key.

func (Header) Del

func (h Header) Del(key string)

Del deletes the values associated with key.

func (Header) Get

func (h Header) Get(key string) string

Get gets the first value associated with the given key. If there are no values associated with the key, Get returns "".

func (Header) Set

func (h Header) Set(key, value string)

Set sets the header entries associated with key to the single element value. It replaces any existing values associated with key.

func (Header) String

func (h Header) String() (s string)

type Request

type Request struct {
	Body            []byte
	Header          Header
	Method          string
	URL             *gourl.URL
	Timeout         time.Duration
	WithCredentials bool
}

func NewRequest

func NewRequest(method string, url string, body []byte) (*Request, error)

type Response

type Response struct {
	Body       []byte
	Status     string
	StatusCode int
	Header     Header
}

func Do

func Do(req *Request) (*Response, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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