Documentation
¶
Index ¶
- Constants
- func ConvertHeadersToHttp(headers []Header) http.Header
- func ConvertQueriesToUrl(queries []Query, url url.Values) url.Values
- func SendRequest(client HttpClient, req *Request) (*http.Response, error)
- func SendRequestWithContext(ctx context.Context, client HttpClient, req *Request) (*http.Response, error)
- type Header
- type HttpClient
- type Query
- type Request
- type Response
- type ResponseVar
Constants ¶
View Source
const TimeoutRequest = 60 * time.Second
Variables ¶
This section is empty.
Functions ¶
func ConvertHeadersToHttp ¶
func SendRequest ¶
func SendRequest(client HttpClient, req *Request) (*http.Response, error)
func SendRequestWithContext ¶
Types ¶
type Header ¶
type HttpClient ¶
func New ¶
func New() HttpClient
type Response ¶
type Response struct {
StatusCode int `json:"statusCode"`
Body []byte `json:"body"`
Headers []Header `json:"headers"`
}
func SendRequestAndConvert ¶
type ResponseVar ¶
type ResponseVar struct {
StatusCode int `json:"status"`
Body any `json:"body"`
Headers map[string]string `json:"headers"`
Duration int32 `json:"duration"`
}
func ConvertResponseToVar ¶
func ConvertResponseToVar(r Response) ResponseVar
Click to show internal directories.
Click to hide internal directories.