client

package
v2.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2024 License: MIT Imports: 11 Imported by: 0

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

type RequestError struct {
	StatusCode   int
	ResponseData map[string]interface{}
	Err          error
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL