Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // Get makes a get request Get(ctx context.Context, req Request) (Response, error) // Post makes a post request Post(ctx context.Context, req Request) (Response, error) // Put makes a put request Put(ctx context.Context, req Request) (Response, error) }
Client allows making http requests
func NewDefaultClient ¶
NewDefaultClient creates an instance of Client
type DefaultClient ¶
type DefaultClient struct{}
DefaultClient defines the default and basic handler to make requests
type DefaultRequest ¶
type DefaultRequest struct {
// contains filtered or unexported fields
}
DefaultRequest defines the default and basic instance of a request
func (*DefaultRequest) AddHeader ¶
func (r *DefaultRequest) AddHeader(header string, value string)
AddHeader adds custom headers to the request
func (*DefaultRequest) GetHeaders ¶
func (r *DefaultRequest) GetHeaders() map[string]string
GetHeaders returns all configured headers
func (*DefaultRequest) GetPayload ¶
func (r *DefaultRequest) GetPayload() ([]byte, error)
GetPayload returns the payload of the request
func (*DefaultRequest) GetURL ¶
func (r *DefaultRequest) GetURL() string
GetURL returns the URL of the request
type DefaultResponse ¶
type DefaultResponse struct {
// contains filtered or unexported fields
}
DefaultResponse defines the default and basic instance of a response
func (*DefaultResponse) GetBody ¶
func (r *DefaultResponse) GetBody() []byte
GetBody returns the payload of the response
func (*DefaultResponse) GetStatusCode ¶
func (r *DefaultResponse) GetStatusCode() int
GetStatusCode returns the http code of the response
type Request ¶
type Request interface { // AddHeader adds custom headers to the request AddHeader(header string, value string) // GetHeaders returns all configured headers GetHeaders() map[string]string // GetPayload returns the payload of the request GetPayload() ([]byte, error) // GetURL returns the URL of the request GetURL() string }
Request holds all the information to make a http request
func NewDefaultRequest ¶
NewDefaultRequest creates an instance of Request