http

package
v0.38.314 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: Apache-2.0 Imports: 19 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) ConnectTo added in v0.38.16

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

func (*HTTPRequest) DNSCache added in v0.38.9

func (h *HTTPRequest) DNSCache(cache bool) *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) 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) NTLMv2 added in v0.38.7

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

func (*HTTPRequest) Timeout added in v0.38.85

func (h *HTTPRequest) Timeout(timeout time.Duration) *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
	Response *http.Response
	Elapsed  time.Duration
	Error    error
	// contains filtered or unexported fields
}

func NewHTTPResponse

func NewHTTPResponse(req *HTTPRequest, resp *http.Response, start time.Time) *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) GetHeaders added in v0.38.5

func (h *HTTPResponse) GetHeaders() map[string]string

func (*HTTPResponse) GetSSLAge

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

func (*HTTPResponse) GetStatusCode added in v0.38.5

func (h *HTTPResponse) GetStatusCode() int

GetStatusCode returns the HTTP Status Code or -1 if there was a network error

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