Documentation
¶
Overview ¶
Package httptool provides utilities for http request
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TryReadErrorResponse ¶
TryReadErrorResponse tries to convert response body to an error message.
Types ¶
type CarbonBlackAccessInfo ¶
type CarbonBlackAccessInfo struct {
// contains filtered or unexported fields
}
CarbonBlackAccessInfo contains the api id and api key for Carbon Black.
func (CarbonBlackAccessInfo) GetToken ¶
func (c CarbonBlackAccessInfo) GetToken() string
GetToken generates auth token from api key & id, A normal Carbon Black Access Token will be in the format of '<api-key>/<api-id>'.
type RequestSession ¶
type RequestSession struct {
// contains filtered or unexported fields
}
RequestSession is the session used for sending request.
func NewRequestSession ¶
func NewRequestSession(apiID, apiKey string) *RequestSession
NewRequestSession creates a new request session.
func (RequestSession) RequestData ¶
func (r RequestSession) RequestData(method, url string, payload interface{}) (int, []byte, error)
RequestData will request data via method to url with payload.
Click to show internal directories.
Click to hide internal directories.