Documentation ¶
Index ¶
- Constants
- func BuildUrl[T any](base string, options T) (string, error)
- func Call[R any](options CallOptions, ...) (R, error)
- func FromBytes[T any](data []byte) (*T, error)
- func Read(resp *http.Response) ([]byte, error)
- type CallOptionFunction
- type CallOptions
- type ContentType
- type Header
- type HeaderMap
- type Result
Constants ¶
View Source
const HEADER_AUTHORIZATION = "Authorization"
View Source
const HEADER_CONTENT_TYPE = "Content-Type"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CallOptionFunction ¶
type CallOptionFunction func(c *CallOptions)
func WithBase ¶
func WithBase(base string) CallOptionFunction
func WithBody ¶
func WithBody(b any) CallOptionFunction
func WithHeader ¶
func WithHeader(name string, value string) CallOptionFunction
func WithMethod ¶
func WithMethod(method string) CallOptionFunction
func WithQuery ¶
func WithQuery(q any) CallOptionFunction
type CallOptions ¶
func NewCallOptions ¶
func NewCallOptions(options ...CallOptionFunction) CallOptions
func (*CallOptions) GetRequest ¶
func (c *CallOptions) GetRequest() (*http.Request, error)
func (*CallOptions) GetUrl ¶
func (c *CallOptions) GetUrl() (string, error)
type ContentType ¶
type ContentType string
const CONTENT_TYPE_FORM_URLENCODED ContentType = "application/x-www-form-urlencoded; param=value"
const CONTENT_TYPE_JSON ContentType = "application/json"
type Header ¶
func (*Header) SetAuthorization ¶
func (*Header) SetContentType ¶
func (h *Header) SetContentType(contentType ContentType)
Click to show internal directories.
Click to hide internal directories.