Documentation
¶
Index ¶
- Constants
- Variables
- func Deregister(name string)
- func NewBuilder() container.StandardBuilder
- func Register(resolver httpResolver)
- type Body
- type Client
- type Options
- type RequestOption
- func WithContentType(contentType string) RequestOption
- func WithContentTypeJSON() RequestOption
- func WithContentTypeUrlencoded() RequestOption
- func WithHeaders(header map[string]string) RequestOption
- func WithMethod(method string) RequestOption
- func WithRespHandler(handler RespHandler) RequestOption
- func WithXRequestID(requestID string) RequestOption
- type RespHandler
- type StandardHttp
Constants ¶
View Source
const TypeNode = "xhttp"
Variables ¶
View Source
var ( ContentTypeApplicationJSON = constants.ContentTypeApplicationJSON ContentTypeTextPlain = constants.ContentTypeTextPlain ContentTypeUrlencoded = constants.ContentTypeUrlencoded )
Functions ¶
func NewBuilder ¶
func NewBuilder() container.StandardBuilder
Types ¶
type Options ¶
type Options struct { Method string Version string Header xtypes.SMap Handler RespHandler }
type RequestOption ¶
type RequestOption func(*Options)
func WithContentType ¶
func WithContentType(contentType string) RequestOption
WithContentType sets the content type for the request.
func WithContentTypeJSON ¶ added in v0.7.8
func WithContentTypeJSON() RequestOption
WithContentTypeJSON sets the content type to JSON for the request.
func WithContentTypeUrlencoded ¶ added in v0.7.8
func WithContentTypeUrlencoded() RequestOption
WithContentTypeUrlencoded sets the content type to urlencoded for the request.
func WithHeaders ¶
func WithHeaders(header map[string]string) RequestOption
WithHeaders sets the headers for the request.
func WithMethod ¶
func WithMethod(method string) RequestOption
WithMethod sets the method for the request.
func WithRespHandler ¶ added in v0.7.8
func WithRespHandler(handler RespHandler) RequestOption
WithRespHandler sets the response handler for the request.
func WithXRequestID ¶
func WithXRequestID(requestID string) RequestOption
WithXRequestID sets the request ID for the request.
type RespHandler ¶ added in v0.7.8
type RespHandler = httputil.RespHandler
type StandardHttp ¶
Click to show internal directories.
Click to hide internal directories.