Documentation
¶
Index ¶
Constants ¶
View Source
const ( ContentTypeJson = "json" ContentTypeFormData = "form-data" ContentTypeSSML = "application/ssml+xml" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ReqParamsOption ¶
type ReqParamsOption func(*requestParamsDto)
func SetBasicAuth ¶
func SetBasicAuth(username, password string) ReqParamsOption
func WithContentType ¶
func WithContentType(contentType string) ReqParamsOption
func WithReqHeader ¶
func WithReqHeader(header http.Header) ReqParamsOption
func WithTimeout ¶
func WithTimeout(millionSecond uint32) ReqParamsOption
type ResponseDto ¶
func Delete ¶
func Delete(ctx context.Context, url string, params map[string]any, opts ...ReqParamsOption) *ResponseDto
func Get ¶
func Get(ctx context.Context, url string, params map[string]any, opts ...ReqParamsOption) *ResponseDto
Get 返回结果json化,并只取了result或data
func Post ¶
func Post(ctx context.Context, url string, params map[string]any, opts ...ReqParamsOption) *ResponseDto
Post 返回结果json化,并只取了result或data
func (*ResponseDto) Result ¶
func (r *ResponseDto) Result() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.