urlutil

package
v0.0.0-...-de37f70 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindURLByRel

func FindURLByRel(links []httputil.Link, rel string) (string, error)

func Join

func Join(path string, elements ...string) string

Types

type HttpClient

type HttpClient struct {
	*http.Client
}

func NewClient

func NewClient(timeout time.Duration) HttpClient

func (HttpClient) Delete

func (c HttpClient) Delete(url string) (*http.Response, error)

func (HttpClient) DeleteResource

func (c HttpClient) DeleteResource(t *testing.T, location *url.URL)

func (HttpClient) Get

func (c HttpClient) Get(url string) (*http.Response, error)

func (HttpClient) GetStruct

func (c HttpClient) GetStruct(url string, s interface{}) error

func (HttpClient) Post

func (c HttpClient) Post(url, requestBody string) (*http.Response, error)

func (HttpClient) PostAndAssert

func (c HttpClient) PostAndAssert(url, requestBody, bodyContent string, t *testing.T) *http.Response

func (HttpClient) PostResource

func (c HttpClient) PostResource(url, requestBody string) (location *url.URL, err error)

func (HttpClient) PostResourceAndAssert

func (c HttpClient) PostResourceAndAssert(url, requestBody, bodyContent string, t *testing.T) *url.URL

func (HttpClient) PostStruct

func (c HttpClient) PostStruct(url string, body interface{}) (*http.Response, error)

func (HttpClient) PostWithStructResponse

func (c HttpClient) PostWithStructResponse(url, requestBody string, response interface{}) error

func (HttpClient) PutMultipart

func (c HttpClient) PutMultipart(url string, form map[string]string, fileContent []byte, fileContentType string) (*http.Response, error)

Jump to

Keyboard shortcuts

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