Documentation
¶
Index ¶
- Constants
- func BindJSON(r *http.Request, obj any) error
- func BindProto(r *http.Request, msg proto.Message, protovalidate bool) error
- func Client() *resty.Client
- func ContentType(h http.Header) string
- func HttpForm(ctx context.Context, url string, form url.Values, header ...http.Header) (resp *resty.Response, err error)
- func HttpGet(ctx context.Context, url string, query url.Values, header ...http.Header) (resp *resty.Response, err error)
- func HttpPost(ctx context.Context, url string, body any, header ...http.Header) (resp *resty.Response, err error)
- func NewHttpClient() *http.Client
- func ParseProto(r *http.Request, msg proto.Message) error
- type ApiResult
- func HttpFormX[T any](ctx context.Context, url string, form url.Values, header ...http.Header) (ret *ApiResult[T], err error)
- func HttpGetX[T any](ctx context.Context, url string, query url.Values, header ...http.Header) (ret *ApiResult[T], err error)
- func HttpPostX[T any](ctx context.Context, url string, body any, header ...http.Header) (ret *ApiResult[T], err error)
Constants ¶
View Source
const ( HeaderAccept = "Accept" HeaderAuthorization = "Authorization" HeaderContentType = "Content-Type" )
View Source
const ( ContentText = "text/plain; charset=utf-8" ContentJSON = "application/json" ContentXML = "application/xml" ContentForm = "application/x-www-form-urlencoded" ContentStream = "application/octet-stream" ContentMultipartForm = "multipart/form-data" )
Variables ¶
This section is empty.
Functions ¶
func ContentType ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.