client

package
v0.0.0-...-4aff305 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2018 License: GPL-3.0 Imports: 8 Imported by: 2

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 represents a http client that has a one to one relationship with a url

func New

func New(client *http.Client, protocol, host string) *Client

New creates a Client with the http.Client and url

func (*Client) Get

func (c *Client) Get(u string) (b []byte, err error)

Get a request to the url associated. If the response returns anything other than a StatusOK (200), then it will return an error.

func (*Client) Host

func (c *Client) Host() string

Host returns the associated host

func (*Client) Post

func (c *Client) Post(u string, p []byte) (b []byte, err error)

Post a request to the url associated. If the response returns anything other than a StatusOK (200), then it will return an error.

Jump to

Keyboard shortcuts

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