restclient

package
v0.0.0-...-0a224c4 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2016 License: Apache-2.0 Imports: 6 Imported by: 75

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInsecureHTTPSClient

func GetInsecureHTTPSClient() *http.Client

func HealthCheck

func HealthCheck(url string, headerMap map[string]string, timeout time.Duration) (returnedResult bool, returnedError error)

func Request

func Request(method string, url string, body interface{}, headerMap map[string]string, useJsonNumberInsteadFloat64ForResultJson bool) (returnedStatusCode int, returnedJsonMapOrJsonSlice interface{}, returnedResponseBody *string, returnedError error)

func RequestByteSliceResult

func RequestByteSliceResult(method string, url string, body map[string]interface{}, headerMap map[string]string) (returnedStatusCode int, returnedByteSlice []byte, returnedError error)

func RequestDelete

func RequestDelete(url string, body interface{}, headerMap map[string]string, useJsonNumberInsteadFloat64ForResultJson bool) (interface{}, error)

func RequestDeleteByteSliceResult

func RequestDeleteByteSliceResult(url string, body map[string]interface{}, headerMap map[string]string) ([]byte, error)

func RequestDeleteWithStructure

func RequestDeleteWithStructure(url string, body interface{}, returnedStrucutre interface{}, headerMap map[string]string) (interface{}, error)

func RequestGet

func RequestGet(url string, headerMap map[string]string, useJsonNumberInsteadFloat64ForResultJson bool) (interface{}, error)

func RequestGetByteSliceResult

func RequestGetByteSliceResult(url string, headerMap map[string]string) ([]byte, error)

func RequestGetWithStructure

func RequestGetWithStructure(url string, returnedStrucutre interface{}, headerMap map[string]string) (interface{}, error)

func RequestPost

func RequestPost(url string, body interface{}, headerMap map[string]string, useJsonNumberInsteadFloat64ForResultJson bool) (interface{}, error)

func RequestPostByteSliceResult

func RequestPostByteSliceResult(url string, body map[string]interface{}, headerMap map[string]string) ([]byte, error)

func RequestPostWithStructure

func RequestPostWithStructure(url string, body interface{}, returnedStrucutre interface{}, headerMap map[string]string) (interface{}, error)

func RequestPut

func RequestPut(url string, body interface{}, headerMap map[string]string, useJsonNumberInsteadFloat64ForResultJson bool) (interface{}, error)

func RequestPutByteSliceResult

func RequestPutByteSliceResult(url string, body map[string]interface{}, headerMap map[string]string) ([]byte, error)

func RequestPutWithStructure

func RequestPutWithStructure(url string, body interface{}, returnedStrucutre interface{}, headerMap map[string]string) (interface{}, error)

func RequestWithStructure

func RequestWithStructure(method string, url string, body interface{}, returnedStructure interface{}, headerMap map[string]string) (returnedStatusCode int, returnedJsonMapOrJsonSlice interface{}, returnedResponseBody *string, returnedError error)

Types

type RequestError

type RequestError struct {
	Url           string
	StatusCode    int
	ResponseData  interface{}
	ResponseBody  *string
	ReturnedError error
}

func (RequestError) AllData

func (requestError RequestError) AllData() string

func (RequestError) Error

func (requestError RequestError) Error() string

Jump to

Keyboard shortcuts

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