request

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPRequest

type HTTPRequest interface {
	WithJson(requestModel interface{}) HTTPRequest
	WithXml(requestModel interface{}) HTTPRequest
	WithFromURLEncoded(formData map[string]interface{}) HTTPRequest
	WithContext(context context.Context) HTTPRequest
	WithBasicAuth(username string, password string) HTTPRequest
	WithJWTAuth(token string) HTTPRequest
	WithQueryParameters(queryParam map[string]string) HTTPRequest
	WithOauth(token string) HTTPRequest
	AddHeaders(key string, value string) HTTPRequest
	AddCookies(cookies *http.Cookie) HTTPRequest
	GetResponseAs(responseModel interface{}) HTTPRequest
	GetResponseStatusCodeAs(httpStatusCode *int) HTTPRequest
	GetResponseCookiesAs(cookies *[]*http.Cookie) HTTPRequest
	GetResponseHeadersAs(respHeaders *map[string][]string) HTTPRequest
	GET(url string) error
	POST(url string) error
	PUT(url string) error
	PATCH(url string) error
	DELETE(url string) error
	Error() error
}

type RestClient

type RestClient interface {
	NewRequest() HTTPRequest
}

func NewRestClient

func NewRestClient(httpClient client.HttpClient) RestClient

Jump to

Keyboard shortcuts

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