http

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetJson

func GetJson(url string, jsonReq interface{}) ([]byte, error)

func GetJsonWithHeaders

func GetJsonWithHeaders(url string, headers map[string]string, jsonReq interface{}) ([]byte, error)

func PostJson

func PostJson(url string, jsonReq interface{}) ([]byte, error)

func PostJsonWithHeaders

func PostJsonWithHeaders(url string, headers map[string]string, jsonReq interface{}) ([]byte, error)

Types

type Client

type Client struct {
	Url          string
	Headers      map[string]string
	StatusCode   int
	Cookies      []*http.Cookie
	RequestData  []byte
	ResponseData []byte
	RetryTimes   int
}

func NewClient

func NewClient(url string) *Client

func (*Client) Get

func (c *Client) Get() error

func (*Client) Post

func (c *Client) Post() error

func (*Client) Request

func (c *Client) Request(method string) error

func (*Client) RequestWithRetry

func (c *Client) RequestWithRetry(method string) error

Jump to

Keyboard shortcuts

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