http

package
v0.0.0-...-0e6b51b Latest Latest
Warning

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

Go to latest
Published: May 11, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const OptionResponseTypeAuto = "auto"
View Source
const OptionResponseTypeByte = "byte"
View Source
const OptionResponseTypeJson = "json"
View Source
const OptionResponseTypeResponse = "response"
View Source
const OptionResponseTypeText = "text"
View Source
const OptionTypeJson = "application/json"
View Source
const OptionTypeMultipart = "multipart/form-data"
View Source
const OptionTypeText = "text/plain"
View Source
const OptionTypeUrlencode = "application/x-www-form-urlencoded"
View Source
const OptionTypeXml = "text/xml"

Variables

This section is empty.

Functions

func CA

func CA() *x509.CertPool

func NewClient

func NewClient() *xhttp.Client

func Send

func Send(options *Options) (interface{}, error)

func SendWithClient

func SendWithClient(client *xhttp.Client, options *Options) (interface{}, error)

Types

type Error

type Error struct {
	StatusCode int               `json:"statusCode"`
	Status     string            `json:"status"`
	Headers    map[string]string `json:"headers"`
	Body       string            `json:"body"`
}

func (*Error) Error

func (E *Error) Error() string

type Options

type Options struct {
	Url             string
	Method          string
	Type            string
	ResponseType    string
	Data            interface{}
	Headers         map[string]string
	RedirectCount   int
	Timeout         time.Duration
	ResponseCharset string
}

Jump to

Keyboard shortcuts

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