request

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(url string, headers Header) ([]byte, error)

func Download

func Download(url, target string, isGzip bool) (string, error)

func Get

func Get(url string, headers Header) ([]byte, error)

func JsonDelete

func JsonDelete(url string, headers Header) ([]byte, error)

func JsonPatch

func JsonPatch(url string, query any, headers Header) ([]byte, error)

func JsonPost

func JsonPost(url string, query any, headers Header) ([]byte, error)

func JsonPut

func JsonPut(url string, query any, headers Header) ([]byte, error)

func Patch

func Patch(url, query string, headers Header) ([]byte, error)

func Post

func Post(url, query string, headers Header) ([]byte, error)

func Put

func Put(url, query string, headers Header) ([]byte, error)

func SaveStream

func SaveStream(reader io.Reader, target string) (string, error)

func TextGet

func TextGet(url string, headers Header) (string, error)

func TextPost

func TextPost(url string, query string, headers Header) (string, error)

func TimingGet

func TimingGet(url string, headers Header, timeout int64) string

Types

type Client

type Client struct {
	Method  string            `note:"请求方法 GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS|CONNECT|TRACE"`
	Url     string            `note:"请求地址"`
	Data    string            `note:"请求数据"`
	Headers map[string]string `note:"请求头"`
	Timeout time.Duration     `note:"超时时间"`
}

func (*Client) JsonRequest

func (c *Client) JsonRequest() ([]byte, error)

func (*Client) Request

func (c *Client) Request() ([]byte, error)

func (*Client) TextRequest

func (c *Client) TextRequest() (string, error)

type H

type H = Header

H Header 的简写别名(兼容旧代码)

type Header map[string]string

Header HTTP 请求头映射

Source Files

  • client.go
  • download.go
  • method.go

Jump to

Keyboard shortcuts

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