Documentation
¶
Index ¶
- func FormRequest(requestUrl, method string, data map[string]string, opts ...Option) ([]byte, int, error)
- func JsonRequest(requestUrl, method string, data map[string]interface{}, opts ...Option) ([]byte, int, error)
- func Request(requestUrl, method string, body io.Reader, opts ...Option) ([]byte, int, error)
- func StreamRequest(requestUrl, method string, body io.Reader, fn func([]byte) error, ...) (int, error)
- type Flusher
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormRequest ¶
func FormRequest(requestUrl, method string, data map[string]string, opts ...Option) ([]byte, int, error)
FormRequest form-data请求
func JsonRequest ¶
func JsonRequest(requestUrl, method string, data map[string]interface{}, opts ...Option) ([]byte, int, error)
JsonRequest json请求
Types ¶
type Flusher ¶
type Flusher struct {
// contains filtered or unexported fields
}
Flusher is a wrapper for http.ResponseWriter with Flush method.
func NewFlusher ¶
func NewFlusher(writer http.ResponseWriter, httpFlusher http.Flusher) *Flusher
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithStreamMaxBufferSize ¶
WithStreamMaxBufferSize 设置流式请求最大缓存大小
func WithTraceContext ¶
WithTraceContext 从context中自动提取trace信息
Click to show internal directories.
Click to hide internal directories.