Documentation ¶
Index ¶
Constants ¶
View Source
const ( SCHEME = "https" OPENAPIHOST = "openapi.baidu.com" SPAPIHOST = "spapi.baidu.com" SDKLANG = "Go" SDKVERSION = "0.1.2" )
View Source
const ( ContentTypeForm = "application/x-www-form-urlencoded" ContentTypeJSON = "application/json" ContentTypeMultiPart = "multipart/form-data" ConverterTypeJSON = "json" ConverterTypePNG = "png" ConverterTypeStream = "octet-stream" )
Variables ¶
This section is empty.
Functions ¶
func NewHTTPClient ¶
func NewHTTPClient(opts ...Option) *httpClient
newHTTPClient 创建一个HTTPClient opts 支持optTimeout 或 optRetry
Types ¶
type OpenAPIError ¶
type OpenAPIError struct { ErrorCode int64 // openapi 错误码 ErrorMsg string // openapi 错误信息 Detail interface{} // 详情 }
网关错误响应结构体
func (*OpenAPIError) Error ¶
func (e *OpenAPIError) Error() string
Click to show internal directories.
Click to hide internal directories.