httpx

package
v0.0.0-...-61829c1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2019 License: Apache-2.0 Imports: 4 Imported by: 22

Documentation

Index

Constants

View Source
const (
	HeaderUserAgent    = "User-Agent"
	HeaderContentType  = "Content-Type"
	HeaderRequestID    = "X-Request-ID"
	HeaderForwardedFor = "X-Forwarded-For"
	HeaderRealIP       = "X-Real-IP"

	HeaderAuthorization = "Authorization"
)
View Source
const (
	MIMEJSON              = "application/json"
	MIMEHTML              = "text/html"
	MIMEXML               = "application/xml"
	MIMEXML2              = "text/xml"
	MIMEPlain             = "text/plain"
	MIMEPOSTForm          = "application/x-www-form-urlencoded"
	MIMEMultipartPOSTForm = "multipart/form-data"
	MIMEPROTOBUF          = "application/x-protobuf"
	MIMEMSGPACK           = "application/x-msgpack"
	MIMEMSGPACK2          = "application/msgpack"
)

Variables

This section is empty.

Functions

func GetClientIPByHeaderForwardedFor

func GetClientIPByHeaderForwardedFor(headerForwardedFor string) string

func GetClientIPByHeaderRealIP

func GetClientIPByHeaderRealIP(headerRealIP string) string

Types

type HTML

type HTML struct {
	bytes.Buffer
}

swagger:strfmt html

func NewHTML

func NewHTML(data []byte) *HTML

func (HTML) ContentType

func (h HTML) ContentType() string

type ICookie

type ICookie interface {
	Cookies() *http.Cookie
}

type IRedirect

type IRedirect interface {
	Redirect(host string) string
	Status() int
}

type MethodDelete

type MethodDelete string

func (MethodDelete) Method

func (m MethodDelete) Method() string

type MethodGet

type MethodGet string

func (MethodGet) Method

func (m MethodGet) Method() string

type MethodHead

type MethodHead string

func (MethodHead) Method

func (m MethodHead) Method() string

type MethodPatch

type MethodPatch string

func (MethodPatch) Method

func (m MethodPatch) Method() string

type MethodPost

type MethodPost string

func (MethodPost) Method

func (m MethodPost) Method() string

type MethodPut

type MethodPut string

func (MethodPut) Method

func (m MethodPut) Method() string

type StatusFound

type StatusFound struct {
	// contains filtered or unexported fields
}

func RedirectWithStatusFound

func RedirectWithStatusFound(uri string) *StatusFound

func (*StatusFound) Error

func (r *StatusFound) Error() string

func (*StatusFound) Redirect

func (r *StatusFound) Redirect(host string) string

func (*StatusFound) Status

func (s *StatusFound) Status() int

type StatusMovedPermanently

type StatusMovedPermanently struct {
	// contains filtered or unexported fields
}

func RedirectWithStatusMovedPermanently

func RedirectWithStatusMovedPermanently(uri string) *StatusMovedPermanently

func (*StatusMovedPermanently) Error

func (r *StatusMovedPermanently) Error() string

func (*StatusMovedPermanently) Redirect

func (r *StatusMovedPermanently) Redirect(host string) string

func (*StatusMovedPermanently) Status

func (s *StatusMovedPermanently) Status() int

type StatusPermanentRedirect

type StatusPermanentRedirect struct {
	// contains filtered or unexported fields
}

func RedirectWithStatusPermanentRedirect

func RedirectWithStatusPermanentRedirect(uri string) *StatusPermanentRedirect

func (*StatusPermanentRedirect) Error

func (r *StatusPermanentRedirect) Error() string

func (*StatusPermanentRedirect) Redirect

func (r *StatusPermanentRedirect) Redirect(host string) string

func (*StatusPermanentRedirect) Status

func (s *StatusPermanentRedirect) Status() int

type StatusSeeOther

type StatusSeeOther struct {
	// contains filtered or unexported fields
}

func RedirectWithStatusSeeOther

func RedirectWithStatusSeeOther(uri string) *StatusSeeOther

func (*StatusSeeOther) Error

func (r *StatusSeeOther) Error() string

func (*StatusSeeOther) Redirect

func (r *StatusSeeOther) Redirect(host string) string

func (*StatusSeeOther) Status

func (s *StatusSeeOther) Status() int

type StatusTemporaryRedirect

type StatusTemporaryRedirect struct {
	// contains filtered or unexported fields
}

func RedirectWithStatusTemporaryRedirect

func RedirectWithStatusTemporaryRedirect(uri string) *StatusTemporaryRedirect

func (*StatusTemporaryRedirect) Error

func (r *StatusTemporaryRedirect) Error() string

func (*StatusTemporaryRedirect) Redirect

func (r *StatusTemporaryRedirect) Redirect(host string) string

func (*StatusTemporaryRedirect) Status

func (s *StatusTemporaryRedirect) Status() int

type WithCookie

type WithCookie struct {
	// contains filtered or unexported fields
}

func (*WithCookie) Cookies

func (c *WithCookie) Cookies() *http.Cookie

func (*WithCookie) SetCookie

func (c *WithCookie) SetCookie(cookie *http.Cookie)

Jump to

Keyboard shortcuts

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