http

package
v2.0.3-0...-9f42ec6 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Username string
	Password string
}

Auth for BasicAuth

type Client

type Client struct {
	Auth Auth
}

Client for HTTP

func NewClient

func NewClient(username string, password string) Client

NewClient

func (Client) Get

func (h Client) Get(url string) (resp []byte, err error)

Get a BasicAuth authenticated resource

func (Client) GetUnmarshalled

func (h Client) GetUnmarshalled(url string, targetPtr interface{}) (err error)

GetUnmarshalled makes a GET HTTP request and unmarshalls the data

func (Client) Post

func (h Client) Post(url string, data interface{}) (resp []byte, err error)

Post an BasicAuth authenticated resource

func (Client) PostUnmarshalled

func (h Client) PostUnmarshalled(url string, data interface{}, target interface{}) (err error)

PostUnmarshalled makes a POST HTTP request and unmarshalls the data

type Json

type Json interface {
	// ToJson encodes the current struct
	ToJson() ([]byte, error)
}

Jump to

Keyboard shortcuts

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