Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) Execute(url, method string, headers map[string]string, ...) (*ResponseConfig, error)
- func (c *Client) ExecuteJson(url, method string, headers map[string]string, ...) (*ResponseConfig, error)
- func (c *Client) ExecuteMultipart(url, method string, headers map[string]string, fieldName, filename string, ...) (*ResponseConfig, error)
- func (c *Client) UpdateTimeout(duration string)
- type ResponseConfig
Constants ¶
View Source
const DefaultTimeout = time.Second * 30
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client struct
func (*Client) Execute ¶
func (c *Client) Execute(url, method string, headers map[string]string, queryParams map[string]interface{}, body string, responseCode int) (*ResponseConfig, error)
Request implementation
func (*Client) ExecuteJson ¶
func (c *Client) ExecuteJson(url, method string, headers map[string]string, queryParams map[string]interface{}, body interface{}, responseCode int) (*ResponseConfig, error)
ExecuteJson execute http request and returns response
func (*Client) ExecuteMultipart ¶ added in v2.2.0
func (c *Client) ExecuteMultipart(url, method string, headers map[string]string, fieldName, filename string, responseCode int) (*ResponseConfig, error)
ExecuteMultipart posts a file as multipart form field "file".
type ResponseConfig ¶
type ResponseConfig struct {
Method string `json:"method"`
URL string `json:"url"`
StatusCode int `json:"statusCode"`
Headers map[string]string `json:"headers"`
Body []byte `json:"-"`
}
ResponseConfig of a request
func (*ResponseConfig) StringBody ¶
func (rc *ResponseConfig) StringBody() string
returns body as string
Click to show internal directories.
Click to hide internal directories.