Documentation ¶
Index ¶
- Constants
- type Auth
- type Cookies
- type FormData
- type FormKV
- type Headers
- type HttpClient
- func (h *HttpClient) Connect(url string, opts ...any) (*MiniResponse, error)
- func (h *HttpClient) Delete(url string, opts ...any) (*MiniResponse, error)
- func (h *HttpClient) Get(url string, opts ...any) (*MiniResponse, error)
- func (h *HttpClient) Head(url string, opts ...any) (*MiniResponse, error)
- func (h *HttpClient) Options(url string, opts ...any) (*MiniResponse, error)
- func (h *HttpClient) Patch(url string, opts ...any) (*MiniResponse, error)
- func (h *HttpClient) Post(url string, opts ...any) (*MiniResponse, error)
- func (h *HttpClient) Put(url string, opts ...any) (*MiniResponse, error)
- func (h *HttpClient) Request(url string, opts ...any) (*MiniResponse, error)
- func (h *HttpClient) SetAutoRedirectDisable(t bool)
- func (h *HttpClient) SetInsecure(t bool)
- func (h *HttpClient) SetProxy(addr string)
- func (h *HttpClient) SetTimeout(t int)
- func (h *HttpClient) Trace(url string, opts ...any) (*MiniResponse, error)
- type JSONData
- type MiniResponse
- type Params
Constants ¶
View Source
const DefaultUA = "MiniRequest/" + DefaultVer
DefaultUA Default User-Agent
View Source
const DefaultVer = "2.0.0"
DefaultVer Library version
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HttpClient ¶
type HttpClient struct { Method string // Request Method AutoRedirectDisable bool // automatic redirection Socks5Address string // socks5 proxy addr Insecure bool // allow insecure request Timeout int // request timeout }
func NewClient ¶
func NewClient() *HttpClient
func (*HttpClient) Connect ¶ added in v2.0.8
func (h *HttpClient) Connect(url string, opts ...any) (*MiniResponse, error)
func (*HttpClient) Delete ¶
func (h *HttpClient) Delete(url string, opts ...any) (*MiniResponse, error)
func (*HttpClient) Get ¶
func (h *HttpClient) Get(url string, opts ...any) (*MiniResponse, error)
func (*HttpClient) Head ¶ added in v2.0.8
func (h *HttpClient) Head(url string, opts ...any) (*MiniResponse, error)
func (*HttpClient) Options ¶ added in v2.0.8
func (h *HttpClient) Options(url string, opts ...any) (*MiniResponse, error)
func (*HttpClient) Patch ¶
func (h *HttpClient) Patch(url string, opts ...any) (*MiniResponse, error)
func (*HttpClient) Post ¶
func (h *HttpClient) Post(url string, opts ...any) (*MiniResponse, error)
func (*HttpClient) Put ¶
func (h *HttpClient) Put(url string, opts ...any) (*MiniResponse, error)
func (*HttpClient) Request ¶
func (h *HttpClient) Request(url string, opts ...any) (*MiniResponse, error)
Request Universal client
func (*HttpClient) SetAutoRedirectDisable ¶ added in v2.0.10
func (h *HttpClient) SetAutoRedirectDisable(t bool)
SetAutoRedirectDisable Disable Redirect
func (*HttpClient) SetInsecure ¶ added in v2.0.9
func (h *HttpClient) SetInsecure(t bool)
SetInsecure Allow Insecure
func (*HttpClient) SetProxy ¶ added in v2.0.9
func (h *HttpClient) SetProxy(addr string)
SetProxy Set socks5 proxy
func (*HttpClient) SetTimeout ¶ added in v2.0.9
func (h *HttpClient) SetTimeout(t int)
SetTimeout Set timeout
func (*HttpClient) Trace ¶ added in v2.0.8
func (h *HttpClient) Trace(url string, opts ...any) (*MiniResponse, error)
type MiniResponse ¶ added in v2.0.7
func (*MiniResponse) RawData ¶ added in v2.0.7
func (res *MiniResponse) RawData() ([]byte, error)
RawData bytes data
func (*MiniResponse) RawJSON ¶ added in v2.0.7
func (res *MiniResponse) RawJSON() (any, error)
RawJSON JSON data
func (*MiniResponse) RawNumJSON ¶ added in v2.0.7
func (res *MiniResponse) RawNumJSON() (any, error)
RawNumJSON JSON data with real number
Click to show internal directories.
Click to hide internal directories.