Documentation
¶
Index ¶
- Variables
- type Accept
- type AttrAutoCopyResBody
- type AttrBody
- func Bytes(body []byte) *AttrBody
- func Css(body string) *AttrBody
- func File(filename string) *AttrBody
- func Form(body map[string]any) *AttrBody
- func FormData(fields, files map[string]string) *AttrBody
- func Html(body string) *AttrBody
- func Javascript(body string) *AttrBody
- func Json(body any) *AttrBody
- func Plain(body string) *AttrBody
- func Reader(body io.ReadCloser) *AttrBody
- type AttrCert
- type AttrHeaders
- func (my *AttrHeaders) Accept(accept Accept) *AttrHeaders
- func (my *AttrHeaders) Append(headers map[string][]string) *AttrHeaders
- func (my *AttrHeaders) AppendOne(key string, values ...string) *AttrHeaders
- func (my *AttrHeaders) Authorization(username, password, title string) *AttrHeaders
- func (my *AttrHeaders) ContentType(contentType ContentType) *AttrHeaders
- func (my *AttrHeaders) Error() error
- func (my *AttrHeaders) Register(req *HttpClient)
- type AttrMethod
- type AttrQueries
- type AttrSetHeaders
- func (my *AttrSetHeaders) Accept(accept Accept) *AttrSetHeaders
- func (my *AttrSetHeaders) Authorization(username, password, title string) *AttrSetHeaders
- func (my *AttrSetHeaders) ContentType(contentType ContentType) *AttrSetHeaders
- func (my *AttrSetHeaders) Error() error
- func (my *AttrSetHeaders) Register(req *HttpClient)
- type AttrTimeout
- type AttrTransport
- type AttrUrl
- type ContentType
- type HttpClient
- func (my *HttpClient) Error() error
- func (my *HttpClient) GetBody() []byte
- func (my *HttpClient) GetCert() []byte
- func (my *HttpClient) GetClient() *http.Client
- func (my *HttpClient) GetHeaders() map[string][]string
- func (my *HttpClient) GetMethod() string
- func (my *HttpClient) GetQueries() map[string]any
- func (my *HttpClient) GetRawRequest() *http.Request
- func (my *HttpClient) GetRawResponse() *http.Response
- func (my *HttpClient) GetTimeout() time.Duration
- func (my *HttpClient) GetTransport() *http.Transport
- func (my *HttpClient) GetUrl() string
- func (*HttpClient) New(options ...HttpClientAttributer) *HttpClient
- func (*HttpClient) NewDelete(options ...HttpClientAttributer) *HttpClient
- func (*HttpClient) NewGet(options ...HttpClientAttributer) *HttpClient
- func (*HttpClient) NewHead(options ...HttpClientAttributer) *HttpClient
- func (*HttpClient) NewOptions(options ...HttpClientAttributer) *HttpClient
- func (*HttpClient) NewPatch(options ...HttpClientAttributer) *HttpClient
- func (*HttpClient) NewPost(options ...HttpClientAttributer) *HttpClient
- func (*HttpClient) NewPut(options ...HttpClientAttributer) *HttpClient
- func (*HttpClient) NewTrace(options ...HttpClientAttributer) *HttpClient
- func (my *HttpClient) ParseBody()
- func (my *HttpClient) Send() *HttpClient
- func (my *HttpClient) Set(options ...HttpClientAttributer) *HttpClient
- func (my *HttpClient) ToBytes() []byte
- func (my *HttpClient) ToJson(target any, keys ...any) *HttpClient
- func (my *HttpClient) ToWriter(writer http.ResponseWriter) *HttpClient
- func (my *HttpClient) ToXml(target any) *HttpClient
- type HttpClientAttributer
- type HttpClientBuilder
- type Launch
Constants ¶
This section is empty.
Variables ¶
View Source
var ( APP Launch HttpClientApp HttpClient HttpClientBuilderApp HttpClientBuilder )
View Source
var ( ContentTypeJson ContentType = "json" ContentTypeXml ContentType = "xml" ContentTypeXWwwFormUrlencoded ContentType = "form" ContentTypeFormData ContentType = "form-data" ContentTypePlain ContentType = "plain" ContentTypeHtml ContentType = "html" ContentTypeCss ContentType = "css" ContentTypeJavascript ContentType = "javascript" ContentTypeSteam ContentType = "steam" ContentTypes = map[ContentType]string{ ContentTypeJson: "application/json", ContentTypeXml: "application/xml", ContentTypeXWwwFormUrlencoded: "application/x-www-form-urlencoded", ContentTypeFormData: "form-data", ContentTypePlain: "text/plain", ContentTypeHtml: "text/html", ContentTypeCss: "text/css", ContentTypeJavascript: "text/javascript", ContentTypeSteam: "application/octet-stream", } AcceptJson Accept = "json" AcceptXml Accept = "xml" AcceptPlain Accept = "plain" AcceptHtml Accept = "html" AcceptCss Accept = "css" AcceptJavascript Accept = "javascript" AcceptSteam Accept = "steam" AcceptAny Accept = "any" Accepts = map[Accept]string{ AcceptJson: "application/json", AcceptXml: "application/xml", AcceptPlain: "text/plain", AcceptHtml: "text/html", AcceptCss: "text/css", AcceptJavascript: "text/javascript", AcceptSteam: "application/octet-stream", AcceptAny: "*/*", } )
Functions ¶
This section is empty.
Types ¶
type AttrAutoCopyResBody ¶ added in v1.35.9
type AttrAutoCopyResBody struct {
// contains filtered or unexported fields
}
func AutoCopy ¶ added in v1.24.7
func AutoCopy(autoCopy bool) *AttrAutoCopyResBody
func (*AttrAutoCopyResBody) Error ¶ added in v1.35.9
func (*AttrAutoCopyResBody) Error() error
func (*AttrAutoCopyResBody) Register ¶ added in v1.35.9
func (my *AttrAutoCopyResBody) Register(req *HttpClient)
type AttrBody ¶ added in v1.35.9
type AttrBody struct {
// contains filtered or unexported fields
}
func Javascript ¶
func Reader ¶
func Reader(body io.ReadCloser) *AttrBody
func (*AttrBody) Register ¶ added in v1.35.9
func (my *AttrBody) Register(req *HttpClient)
type AttrCert ¶ added in v1.35.9
type AttrCert struct {
// contains filtered or unexported fields
}
func (*AttrCert) Register ¶ added in v1.35.9
func (my *AttrCert) Register(req *HttpClient)
type AttrHeaders ¶ added in v1.35.9
type AttrHeaders struct {
// contains filtered or unexported fields
}
func Headers ¶ added in v1.24.7
func Headers(headers map[string][]string) *AttrHeaders
func (*AttrHeaders) Accept ¶ added in v1.35.9
func (my *AttrHeaders) Accept(accept Accept) *AttrHeaders
func (*AttrHeaders) Append ¶ added in v1.35.9
func (my *AttrHeaders) Append(headers map[string][]string) *AttrHeaders
func (*AttrHeaders) AppendOne ¶ added in v1.35.9
func (my *AttrHeaders) AppendOne(key string, values ...string) *AttrHeaders
func (*AttrHeaders) Authorization ¶ added in v1.35.9
func (my *AttrHeaders) Authorization(username, password, title string) *AttrHeaders
func (*AttrHeaders) ContentType ¶ added in v1.35.9
func (my *AttrHeaders) ContentType(contentType ContentType) *AttrHeaders
func (*AttrHeaders) Error ¶ added in v1.35.9
func (my *AttrHeaders) Error() error
func (*AttrHeaders) Register ¶ added in v1.35.9
func (my *AttrHeaders) Register(req *HttpClient)
type AttrMethod ¶ added in v1.35.9
type AttrMethod struct {
// contains filtered or unexported fields
}
func Method ¶ added in v1.24.7
func Method(method string) *AttrMethod
func (*AttrMethod) Error ¶ added in v1.35.9
func (my *AttrMethod) Error() error
func (*AttrMethod) Register ¶ added in v1.35.9
func (my *AttrMethod) Register(req *HttpClient)
type AttrQueries ¶ added in v1.35.9
type AttrQueries struct {
// contains filtered or unexported fields
}
func Queries ¶ added in v1.24.7
func Queries(queries map[string]any) *AttrQueries
func (*AttrQueries) Append ¶ added in v1.35.9
func (my *AttrQueries) Append(queries map[string]any) *AttrQueries
func (*AttrQueries) AppendOne ¶ added in v1.35.9
func (my *AttrQueries) AppendOne(key string, value any) *AttrQueries
func (*AttrQueries) Error ¶ added in v1.35.9
func (my *AttrQueries) Error() error
func (*AttrQueries) Register ¶ added in v1.35.9
func (my *AttrQueries) Register(req *HttpClient)
type AttrSetHeaders ¶ added in v1.35.9
type AttrSetHeaders struct {
// contains filtered or unexported fields
}
func SetHeaders ¶
func SetHeaders(headers map[string][]string) *AttrSetHeaders
func (*AttrSetHeaders) Accept ¶ added in v1.35.9
func (my *AttrSetHeaders) Accept(accept Accept) *AttrSetHeaders
func (*AttrSetHeaders) Authorization ¶ added in v1.35.9
func (my *AttrSetHeaders) Authorization(username, password, title string) *AttrSetHeaders
func (*AttrSetHeaders) ContentType ¶ added in v1.35.9
func (my *AttrSetHeaders) ContentType(contentType ContentType) *AttrSetHeaders
func (*AttrSetHeaders) Error ¶ added in v1.35.9
func (my *AttrSetHeaders) Error() error
func (*AttrSetHeaders) Register ¶ added in v1.35.9
func (my *AttrSetHeaders) Register(req *HttpClient)
type AttrTimeout ¶ added in v1.35.9
type AttrTimeout struct {
// contains filtered or unexported fields
}
func Timeout ¶ added in v1.24.8
func Timeout(timeout time.Duration) *AttrTimeout
func (*AttrTimeout) Error ¶ added in v1.35.9
func (*AttrTimeout) Error() error
func (*AttrTimeout) Register ¶ added in v1.35.9
func (my *AttrTimeout) Register(req *HttpClient)
type AttrTransport ¶ added in v1.35.9
type AttrTransport struct {
// contains filtered or unexported fields
}
func Transport ¶ added in v1.24.7
func Transport(transport *http.Transport) *AttrTransport
func (*AttrTransport) Error ¶ added in v1.35.9
func (my *AttrTransport) Error() error
func (*AttrTransport) Register ¶ added in v1.35.9
func (my *AttrTransport) Register(req *HttpClient)
type AttrUrl ¶ added in v1.35.9
type AttrUrl struct {
// contains filtered or unexported fields
}
func (*AttrUrl) Register ¶ added in v1.35.9
func (my *AttrUrl) Register(req *HttpClient)
type ContentType ¶
type ContentType string
type HttpClient ¶
type HttpClient struct {
// contains filtered or unexported fields
}
func (*HttpClient) Error ¶
func (my *HttpClient) Error() error
func (*HttpClient) GetBody ¶ added in v1.24.7
func (my *HttpClient) GetBody() []byte
func (*HttpClient) GetCert ¶ added in v1.24.7
func (my *HttpClient) GetCert() []byte
func (*HttpClient) GetClient ¶ added in v1.24.7
func (my *HttpClient) GetClient() *http.Client
func (*HttpClient) GetHeaders ¶ added in v1.24.7
func (my *HttpClient) GetHeaders() map[string][]string
func (*HttpClient) GetMethod ¶ added in v1.24.7
func (my *HttpClient) GetMethod() string
func (*HttpClient) GetQueries ¶ added in v1.24.7
func (my *HttpClient) GetQueries() map[string]any
func (*HttpClient) GetRawRequest ¶ added in v1.24.7
func (my *HttpClient) GetRawRequest() *http.Request
func (*HttpClient) GetRawResponse ¶ added in v1.24.7
func (my *HttpClient) GetRawResponse() *http.Response
func (*HttpClient) GetTimeout ¶ added in v1.24.7
func (my *HttpClient) GetTimeout() time.Duration
func (*HttpClient) GetTransport ¶ added in v1.24.7
func (my *HttpClient) GetTransport() *http.Transport
func (*HttpClient) GetUrl ¶ added in v1.24.7
func (my *HttpClient) GetUrl() string
func (*HttpClient) New ¶
func (*HttpClient) New(options ...HttpClientAttributer) *HttpClient
func (*HttpClient) NewDelete ¶ added in v1.25.29
func (*HttpClient) NewDelete(options ...HttpClientAttributer) *HttpClient
func (*HttpClient) NewGet ¶ added in v1.25.29
func (*HttpClient) NewGet(options ...HttpClientAttributer) *HttpClient
func (*HttpClient) NewHead ¶ added in v1.25.29
func (*HttpClient) NewHead(options ...HttpClientAttributer) *HttpClient
func (*HttpClient) NewOptions ¶ added in v1.25.29
func (*HttpClient) NewOptions(options ...HttpClientAttributer) *HttpClient
func (*HttpClient) NewPatch ¶ added in v1.25.29
func (*HttpClient) NewPatch(options ...HttpClientAttributer) *HttpClient
func (*HttpClient) NewPost ¶ added in v1.25.29
func (*HttpClient) NewPost(options ...HttpClientAttributer) *HttpClient
func (*HttpClient) NewPut ¶ added in v1.25.29
func (*HttpClient) NewPut(options ...HttpClientAttributer) *HttpClient
func (*HttpClient) NewTrace ¶ added in v1.25.29
func (*HttpClient) NewTrace(options ...HttpClientAttributer) *HttpClient
func (*HttpClient) ParseBody ¶ added in v1.24.7
func (my *HttpClient) ParseBody()
func (*HttpClient) Send ¶
func (my *HttpClient) Send() *HttpClient
func (*HttpClient) Set ¶ added in v1.24.7
func (my *HttpClient) Set(options ...HttpClientAttributer) *HttpClient
func (*HttpClient) ToBytes ¶ added in v1.25.12
func (my *HttpClient) ToBytes() []byte
func (*HttpClient) ToJson ¶ added in v1.24.7
func (my *HttpClient) ToJson(target any, keys ...any) *HttpClient
func (*HttpClient) ToWriter ¶ added in v1.24.7
func (my *HttpClient) ToWriter(writer http.ResponseWriter) *HttpClient
func (*HttpClient) ToXml ¶ added in v1.24.7
func (my *HttpClient) ToXml(target any) *HttpClient
type HttpClientAttributer ¶ added in v1.29.16
type HttpClientAttributer interface { Register(req *HttpClient) Error() error // contains filtered or unexported methods }
func Url ¶ added in v1.24.7
func Url(urls ...string) HttpClientAttributer
func Xml ¶
func Xml(body any) HttpClientAttributer
type HttpClientBuilder ¶ added in v1.25.29
type HttpClientBuilder struct {
// contains filtered or unexported fields
}
func (*HttpClientBuilder) GetClient ¶ added in v1.25.29
func (my *HttpClientBuilder) GetClient() *HttpClient
func (*HttpClientBuilder) New ¶ added in v1.25.29
func (*HttpClientBuilder) New(options ...HttpClientAttributer) *HttpClientBuilder
type Launch ¶ added in v1.34.0
type Launch struct { HttpClient HttpClient HttpClientBuilder HttpClientBuilder }
Click to show internal directories.
Click to hide internal directories.