Documentation
¶
Overview ¶
Package httpx 提供各引擎共用的 HTTP Client 默认值(超时等)。
Index ¶
Constants ¶
View Source
const DefaultTimeout = 3 * time.Minute
DefaultTimeout 为未显式配置 Timeout 时的默认请求超时(含连接+TLS+首包+整体)。
Variables ¶
This section is empty.
Functions ¶
func DoJSON ¶ added in v0.9.0
func DoJSON(ctx context.Context, hc *http.Client, method, url, apiKey string, body []byte, prefix string) ([]byte, error)
DoJSON sends a JSON request and returns the response body. It sets Authorization (Bearer) and Content-Type headers automatically. Non-2xx responses are converted to *aigoerr.Error.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.