Documentation
¶
Index ¶
- Variables
- func DecodeHTTPResponseBody(res *http.Response) ([]byte, error)
- func GetHTMLElemValue(body []byte, selector string) (string, error)
- func GetSecCHUA(userAgent string) string
- func GetSecCHUAPlatform(userAgent string) string
- func GetUserAgent() string
- func MergeCookies(httpRes *http.Response, cookies []*http.Cookie) []*http.Cookie
- func NewRequest(ctx context.Context, method string, url string, opts ...NewRequestOpt) (*http.Request, error)
- func ParseJWTClaimsInt(tokenString string, fieldName string) (int, error)
- type NewRequestOpt
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUserIDNotFound = errors.New("userID not found in token claims")
Functions ¶
func DecodeHTTPResponseBody ¶
DecodeHTTPResponseBody decodes HTTP response bytesBody based on Content-Encoding header.
func GetSecCHUA ¶
GetSecCHUA constructs the Sec-CH-UA header value based on the User-Agent.
func GetSecCHUAPlatform ¶
GetSecCHUAPlatform extracts platform from user agent string.
func GetUserAgent ¶
func GetUserAgent() string
func MergeCookies ¶
func NewRequest ¶
Types ¶
type NewRequestOpt ¶
type NewRequestOpt func(*newRequestOpts)
func WithBytesBody ¶
func WithBytesBody(body []byte) NewRequestOpt
func WithCookies ¶
func WithCookies(cookies []*http.Cookie) NewRequestOpt
func WithHeaders ¶
func WithHeaders(headers map[string]string) NewRequestOpt
func WithJSONBody ¶
func WithJSONBody(body any) NewRequestOpt
Click to show internal directories.
Click to hide internal directories.