http

package
v0.38.4 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPRequest

type HTTPRequest struct {
	Username string
	Password string

	Port int
	URL  *url.URL
	// contains filtered or unexported fields
}

func NewRequest

func NewRequest(endpoint string) *HTTPRequest

func (*HTTPRequest) Auth

func (h *HTTPRequest) Auth(username, password string) *HTTPRequest

func (*HTTPRequest) Debug

func (h *HTTPRequest) Debug(debug bool) *HTTPRequest

func (*HTTPRequest) Do

func (h *HTTPRequest) Do(body string) *HTTPResponse

func (*HTTPRequest) GetRequestLine

func (h *HTTPRequest) GetRequestLine() string

func (*HTTPRequest) GetString

func (h *HTTPRequest) GetString() string

func (*HTTPRequest) Header

func (h *HTTPRequest) Header(header, value string) *HTTPRequest

func (*HTTPRequest) Headers

func (h *HTTPRequest) Headers(headers map[string]string) *HTTPRequest

func (*HTTPRequest) Host

func (h *HTTPRequest) Host(host string) *HTTPRequest

func (*HTTPRequest) Insecure

func (h *HTTPRequest) Insecure(skip bool) *HTTPRequest

func (*HTTPRequest) Method

func (h *HTTPRequest) Method(method string) *HTTPRequest

func (*HTTPRequest) NTLM

func (h *HTTPRequest) NTLM(ntlm bool) *HTTPRequest

func (*HTTPRequest) Trace

func (h *HTTPRequest) Trace(trace bool) *HTTPRequest

func (*HTTPRequest) UseHost

func (h *HTTPRequest) UseHost(host string) *HTTPRequest

type HTTPResponse

type HTTPResponse struct {
	Request *HTTPRequest
	Headers map[string]string
	*http.Response
	Elapsed time.Duration
	Error   error
	// contains filtered or unexported fields
}

func NewHTTPResponse

func NewHTTPResponse(req *HTTPRequest, resp *http.Response) *HTTPResponse

func (*HTTPResponse) AsJSON

func (h *HTTPResponse) AsJSON() (*JSON, error)

func (*HTTPResponse) AsString

func (h *HTTPResponse) AsString() (string, error)

func (*HTTPResponse) CheckJSONContent

func (h *HTTPResponse) CheckJSONContent(jsonContent interface{}, jsonCheck v1.JSONCheck) error

func (*HTTPResponse) GetSSLAge

func (h *HTTPResponse) GetSSLAge() *time.Duration

func (*HTTPResponse) IsJSON

func (h *HTTPResponse) IsJSON() bool

func (*HTTPResponse) IsOK

func (h *HTTPResponse) IsOK(responseCodes ...int) bool

func (*HTTPResponse) SetError

func (h *HTTPResponse) SetError(err error) *HTTPResponse

func (*HTTPResponse) Start

func (h *HTTPResponse) Start(start time.Time) *HTTPResponse

func (*HTTPResponse) String

func (h *HTTPResponse) String() string

type JSON

type JSON struct {
	Value interface{}
}

func (JSON) JSONPath

func (j JSON) JSONPath(path string) (string, error)

Jump to

Keyboard shortcuts

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