request

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cli

type Cli struct {
	Client  *http.Client
	Timeout int64
	Heder   map[string]string
}

func NewCli

func NewCli() *Cli

NewCli returns a new Cli with a default http.Client.

func (*Cli) Do

func (c *Cli) Do(r *Req) (body []byte, err error)

Do A simple http client.

func (*Cli) SetTimeout

func (c *Cli) SetTimeout(timeout int64)

Setting the timeout for the http client.

type Req

type Req struct {
	Method string
	Url    string
	Data   []byte
}

func NewReq

func NewReq(method, url string, data []byte) *Req

NewReq returns a pointer to a Req with the given method, url, and data.

Jump to

Keyboard shortcuts

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