Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RequestConfig ¶ added in v2.3.0
type RequestConfig struct { Url string Method string Headers *map[string]string Parameters *url.Values Body interface{} Timeout uint }
HTTP хүсэлтийн тохиргоо
Url: хүсэлтийн url заавал байх ёстой
Method: хүсэлтийн төрөл явуулаагүй үед GET байна
Headers: default-р Content-Type нь application/json байна
Parameters: query parameters хүсэлтийн төрөл GET үед ашиглана
Body: хүсэлтийн бие
Timeout: хүсэлтийн timeout явуулаагүй үед 30сек байна
type RequestError ¶ added in v2.2.0
func MakeHTTPRequest ¶
func MakeHTTPRequest[T any](config *RequestConfig) (*T, *RequestError)
HTTP хүсэлт илгээгч
*RequestConfig: хүсэлтийн тохиргоо
func (*RequestError) Error ¶ added in v2.2.0
func (r *RequestError) Error() string
Click to show internal directories.
Click to hide internal directories.