http

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2015 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const NO_CONTENT_TYPE string = ""

Variables

View Source
var NewRoundTripper = func() http.RoundTripper {
	return &http.Transport{
		TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
	}
}
View Source
var NewTransportClient = func() (client interface {
	Do(*http.Request) (*http.Response, error)
}) {
	tr := &http.Transport{
		TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
	}
	client = &http.Client{Transport: tr}
	return
}

Functions

func MultiPartBody

func MultiPartBody(paramName, filename string, fileRef io.Reader, params map[string]string) (body io.ReadWriter, contentType string, err error)

func MultiPartUpload

func MultiPartUpload(conn ConnAuth, paramName, filename string, fileRef io.Reader, params map[string]string) (res *http.Response, err error)

func Request

func Request(entity HttpRequestEntity, method string, body io.Reader) (response *http.Response, err error)

Types

type ConnAuth

type ConnAuth struct {
	Url      string
	Username string
	Password string
}

type DefaultHttpGateway

type DefaultHttpGateway struct{}

func (*DefaultHttpGateway) Get

func (*DefaultHttpGateway) Post

func (gateway *DefaultHttpGateway) Post(entity HttpRequestEntity, body io.Reader) RequestAdaptor

func (*DefaultHttpGateway) Put

func (gateway *DefaultHttpGateway) Put(entity HttpRequestEntity, body io.Reader) RequestAdaptor

type HttpRequestEntity

type HttpRequestEntity struct {
	Url         string
	Username    string
	Password    string
	ContentType string
}

type MultiPartBodyFunc

type MultiPartBodyFunc func(string, string, io.Reader, map[string]string) (io.ReadWriter, string, error)

type MultiPartUploadFunc

type MultiPartUploadFunc func(conn ConnAuth, paramName, filename string, fileRef io.Reader, params map[string]string) (res *http.Response, err error)

type RequestAdaptor

type RequestAdaptor func() (*http.Response, error)

type RequestFunc

type RequestFunc func(HttpRequestEntity, string, io.Reader) (*http.Response, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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