Documentation ¶
Index ¶
- Constants
- func HttpHeaderToMap(header http.Header) map[string]string
- func ReadClientCharset(r *http.Request) (response string)
- func ReadClientCookies(r *http.Request) (response []*http.Cookie)
- func ReadClientEncoding(r *http.Request) (response string)
- func ReadClientIP(r *http.Request) (response string)
- func ReadClientLang(r *http.Request) (response string)
- func ReadClientUserAgent(r *http.Request) (response string)
- func ReadPayload(rawPayload interface{}) io.Reader
- type HttpClient
- func (instance *HttpClient) AddHeader(key, value string)
- func (instance *HttpClient) Delete(url string, body interface{}) (response *ResponseData, err error)
- func (instance *HttpClient) Get(url string) (response *ResponseData, err error)
- func (instance *HttpClient) Post(url string, body interface{}) (response *ResponseData, err error)
- func (instance *HttpClient) Put(url string, body interface{}) (response *ResponseData, err error)
- func (instance *HttpClient) RemoveHeader(key string)
- func (instance *HttpClient) Upload(url string, filename, optParamName string, optParams map[string]interface{}) (*ResponseData, error)
- func (instance *HttpClient) UploadTimeout(url string, filename, optParamName string, optParams map[string]interface{}, ...) (*ResponseData, error)
- type HttpClientOptions
- type ResponseData
Constants ¶
View Source
const MethodDelete = "DELETE"
View Source
const MethodGet = "GET"
View Source
const MethodPost = "POST"
View Source
const MethodPut = "PUT"
Variables ¶
This section is empty.
Functions ¶
func ReadClientCharset ¶
func ReadClientEncoding ¶
func ReadClientIP ¶
func ReadClientLang ¶
func ReadClientUserAgent ¶
func ReadPayload ¶
Types ¶
type HttpClient ¶
type HttpClient struct {
// contains filtered or unexported fields
}
func NewHttpClient ¶
func NewHttpClient(options ...*HttpClientOptions) *HttpClient
func (*HttpClient) AddHeader ¶
func (instance *HttpClient) AddHeader(key, value string)
func (*HttpClient) Delete ¶
func (instance *HttpClient) Delete(url string, body interface{}) (response *ResponseData, err error)
func (*HttpClient) Get ¶
func (instance *HttpClient) Get(url string) (response *ResponseData, err error)
func (*HttpClient) Post ¶
func (instance *HttpClient) Post(url string, body interface{}) (response *ResponseData, err error)
func (*HttpClient) Put ¶
func (instance *HttpClient) Put(url string, body interface{}) (response *ResponseData, err error)
func (*HttpClient) RemoveHeader ¶
func (instance *HttpClient) RemoveHeader(key string)
func (*HttpClient) Upload ¶
func (instance *HttpClient) Upload(url string, filename, optParamName string, optParams map[string]interface{}) (*ResponseData, error)
func (*HttpClient) UploadTimeout ¶
func (instance *HttpClient) UploadTimeout(url string, filename, optParamName string, optParams map[string]interface{}, timeout time.Duration) (*ResponseData, error)
type HttpClientOptions ¶
type ResponseData ¶
func NewResponseData ¶
func NewResponseData(res *http.Response) (instance *ResponseData, err error)
func NewResponseDataEmpty ¶
func NewResponseDataEmpty() *ResponseData
func (*ResponseData) BodyAsMap ¶
func (instance *ResponseData) BodyAsMap() map[string]interface{}
func (*ResponseData) String ¶
func (instance *ResponseData) String() string
Click to show internal directories.
Click to hide internal directories.