Documentation ¶
Index ¶
- Variables
- func DownloadFile(b *gotgbot.Bot, fileID string) (io.ReadCloser, error)
- func DownloadFileFromGetFile(b *gotgbot.Bot, file *gotgbot.File) (io.ReadCloser, error)
- func MakeRequest(opts RequestOptions) error
- func MultiPartFormRequest(url string, params []MultiPartParam, files []MultiPartFile) (*http.Response, error)
- func MultiPartFormRequestWithHeaders(url string, headers map[string]string, params []MultiPartParam, ...) (*http.Response, error)
- type HTTPMethod
- type HttpError
- type MultiPartFile
- type MultiPartParam
- type RequestOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultHttpClient *http.Client
)
Functions ¶
func DownloadFile ¶
func DownloadFile(b *gotgbot.Bot, fileID string) (io.ReadCloser, error)
func DownloadFileFromGetFile ¶
func DownloadFileFromGetFile(b *gotgbot.Bot, file *gotgbot.File) (io.ReadCloser, error)
func MakeRequest ¶
func MakeRequest(opts RequestOptions) error
func MultiPartFormRequest ¶
func MultiPartFormRequest(url string, params []MultiPartParam, files []MultiPartFile) (*http.Response, error)
func MultiPartFormRequestWithHeaders ¶
func MultiPartFormRequestWithHeaders(url string, headers map[string]string, params []MultiPartParam, files []MultiPartFile) (*http.Response, error)
Types ¶
type HTTPMethod ¶
type HTTPMethod string
const ( MethodGet HTTPMethod = http.MethodGet MethodPost HTTPMethod = http.MethodPost )
type MultiPartFile ¶
type MultiPartParam ¶
type RequestOptions ¶
type RequestOptions struct { Method HTTPMethod URL string Headers map[string]string Body any // Response can either be a pointer to a JSON struct or a pointer to a string Response any // ErrorResponse can either be a pointer to a JSON struct or a pointer to a string. // NOTE: An error will still be returned! ErrorResponse any Client *http.Client }
Click to show internal directories.
Click to hide internal directories.