Documentation ¶
Index ¶
- type HTTPRequest
- func (h *HTTPRequest) Auth(username, password string) *HTTPRequest
- func (h *HTTPRequest) ConnectTo(host string) *HTTPRequest
- func (h *HTTPRequest) DNSCache(cache bool) *HTTPRequest
- func (h *HTTPRequest) Debug(debug bool) *HTTPRequest
- func (h *HTTPRequest) Do(body string) *HTTPResponse
- func (h *HTTPRequest) GetRequestLine() string
- func (h *HTTPRequest) GetString() string
- func (h *HTTPRequest) Header(header, value string) *HTTPRequest
- func (h *HTTPRequest) Headers(headers map[string]string) *HTTPRequest
- func (h *HTTPRequest) Insecure(skip bool) *HTTPRequest
- func (h *HTTPRequest) Method(method string) *HTTPRequest
- func (h *HTTPRequest) NTLM(ntlm bool) *HTTPRequest
- func (h *HTTPRequest) NTLMv2(ntlm bool) *HTTPRequest
- func (h *HTTPRequest) Timeout(timeout time.Duration) *HTTPRequest
- func (h *HTTPRequest) Trace(trace bool) *HTTPRequest
- func (h *HTTPRequest) UseHost(host string) *HTTPRequest
- type HTTPResponse
- func (h *HTTPResponse) AsJSON() (*JSON, error)
- func (h *HTTPResponse) AsString() (string, error)
- func (h *HTTPResponse) CheckJSONContent(jsonContent interface{}, jsonCheck *v1.JSONCheck) error
- func (h *HTTPResponse) GetHeaders() map[string]string
- func (h *HTTPResponse) GetSSLAge() *time.Duration
- func (h *HTTPResponse) GetStatusCode() int
- func (h *HTTPResponse) IsJSON() bool
- func (h *HTTPResponse) IsOK(responseCodes ...int) bool
- func (h *HTTPResponse) SetError(err error) *HTTPResponse
- func (h *HTTPResponse) Start(start time.Time) *HTTPResponse
- func (h *HTTPResponse) String() string
- type JSON
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
Click to show internal directories.
Click to hide internal directories.