Documentation ¶
Index ¶
- Constants
- func BaseURL(protocol string, trimmedURL string, a ...any) string
- func Fetch(url, method string, cacheMaxAge time.Duration, timeout time.Duration, ...) (responseBody io.ReadCloser, statusCode int, err error)
- func FetchFile(url string, cacheMaxAge time.Duration, reportProgress bool) (io.ReadCloser, error)
- func FetchJSON[T any](url string, maxCacheAge time.Duration) (T, error)
- func HasContentType(h http.Header, mimetype string) bool
- func IsTLS(trimmedURL string) (isTLS bool)
- func PostJSON[T any](url string, data any) (T, error)
- func TrimURL(url string) string
Constants ¶
View Source
const FeedbackPkg = feedback.Package("request")
Variables ¶
This section is empty.
Functions ¶
func BaseURL ¶
BaseURL prepends `protocol + "://"` or `protocol + "s://"` to the url depending on TLS support.
func HasContentType ¶
HasContentType returns true if the 'content-type' header includes mimetype.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.