Documentation
¶
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) EndBytes() (res *http.Response, bs []byte, errs []error)
- func (c *Client) EndStruct(v interface{}) (res *http.Response, errs []error)
- func (c *Client) Get(url string) (client *Client)
- func (c *Client) Post(url string) (client *Client)
- func (c *Client) SendString(v string) (client *Client)
- func (c *Client) SendStruct(v interface{}) (client *Client)
- func (c *Client) SetHost(host string) (client *Client)
- func (c *Client) SetTLSConfig(tlsCfg *tls.Config) (client *Client)
- func (c *Client) SetTimeout(timeout time.Duration) (client *Client)
- func (c *Client) Type(typeStr string) (client *Client)
Constants ¶
View Source
const ( POST = "POST" GET = "GET" TypeJSON = "json" TypeXML = "xml" TypeUrlencoded = "urlencoded" TypeForm = "form" TypeFormData = "form-data" )
Variables ¶
View Source
var Types = map[string]string{ TypeJSON: "application/json", TypeXML: "application/xml", TypeForm: "application/x-www-form-urlencoded", TypeFormData: "application/x-www-form-urlencoded", TypeUrlencoded: "application/x-www-form-urlencoded", }
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
HttpClient *http.Client
Transport *http.Transport
Header http.Header
Timeout time.Duration
Url string
Host string
Method string
RequestType string
FormString string
ContentType string
UnmarshalType string
Types map[string]string
JsonByte []byte
Errors []error
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient() (client *Client)
NewClient , default tls.Config{InsecureSkipVerify: true}
func (*Client) SendString ¶
func (*Client) SendStruct ¶
Click to show internal directories.
Click to hide internal directories.