sclient

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: MIT Imports: 7 Imported by: 0

README

Service Client

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultClient = &Client{http.DefaultClient, nil, "", ""}

Functions

func Get

func Get(ctx context.Context, url string, headers ...map[string]string) (*http.Response, []byte, error)

func Post

func Post(ctx context.Context, url string, contentType string, body io.Reader, headers ...map[string]string) (*http.Response, []byte, error)

func PostForm

func PostForm(ctx context.Context, url string, data url.Values, headers ...map[string]string) (*http.Response, []byte, error)

Types

type Client

type Client struct {
	*http.Client
	Headers    map[string]string
	TokenType  stoken.Type
	TokenValue string
}

func (*Client) Do

func (c *Client) Do(req *http.Request, headers ...map[string]string) (*http.Response, []byte, error)

func (*Client) Get

func (c *Client) Get(ctx context.Context, url string, headers ...map[string]string) (*http.Response, []byte, error)

func (*Client) Post

func (c *Client) Post(ctx context.Context, url string, contentType string, body io.Reader, headers ...map[string]string) (*http.Response, []byte, error)

func (*Client) PostForm

func (c *Client) PostForm(ctx context.Context, url string, data url.Values, headers ...map[string]string) (*http.Response, []byte, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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