http

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2019 License: Apache-2.0 Imports: 6 Imported by: 51

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client defines an http client object

func (*Client) SendRequest

func (c *Client) SendRequest(method, url string, body io.Reader, header http.Header, cookies []*http.Cookie) (*http.Response, error)

SendRequest sends an http request with a defined method

func (*Client) SetOptions

func (c *Client) SetOptions(options ClientOptions)

SetOptions sets options used for the http client

type ClientOptions

type ClientOptions struct {
	Timeout  time.Duration
	Username string
	Password string
	Token    string
}

ClientOptions defines the options to be set on the client

type Sender

type Sender interface {
	SendRequest(method, url string, body io.Reader, header http.Header, cookies []*http.Cookie) (*http.Response, error)
	SetOptions(options ClientOptions)
}

Sender provides an interface to the piper http client for uid/pwd authenticated requests

Jump to

Keyboard shortcuts

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