xhttp

package
v1.0.7-beta1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2020 License: Apache-2.0 Imports: 12 Imported by: 6

Documentation

Index

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) EndBytes

func (c *Client) EndBytes() (res *http.Response, bs []byte, errs []error)

func (*Client) EndStruct

func (c *Client) EndStruct(v interface{}) (res *http.Response, errs []error)

func (*Client) Get

func (c *Client) Get(url string) (client *Client)

func (*Client) Post

func (c *Client) Post(url string) (client *Client)

func (*Client) SendString

func (c *Client) SendString(v string) (client *Client)

func (*Client) SendStruct

func (c *Client) SendStruct(v interface{}) (client *Client)

func (*Client) SetHost

func (c *Client) SetHost(host string) (client *Client)

func (*Client) SetTLSConfig

func (c *Client) SetTLSConfig(tlsCfg *tls.Config) (client *Client)

func (*Client) SetTimeout

func (c *Client) SetTimeout(timeout time.Duration) (client *Client)

func (*Client) Type

func (c *Client) Type(typeStr string) (client *Client)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL