Documentation
¶
Index ¶
- func Delete(url string, headers *Headers) (json.RawMessage, error)
- func Get(url string, headers *Headers) (json.RawMessage, error)
- func Post(url string, body any, headers *Headers) (json.RawMessage, error)
- func Put(url string, body any, headers *Headers) (json.RawMessage, error)
- type Headers
- type RequestConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶ added in v1.3.7
func Delete(url string, headers *Headers) (json.RawMessage, error)
Delete sends an HTTP DELETE request to the specified URL with context support. Applies headers and returns the response body as json.RawMessage. Returns an error if the request or response processing fails.
func Get ¶
func Get(url string, headers *Headers) (json.RawMessage, error)
Get sends an HTTP GET request to the specified URL with context support. Applies headers and returns the response body as json.RawMessage. Returns an error if the request or response processing fails.
func Post ¶
Post sends an HTTP POST request with a JSON body to the specified URL with context support. Applies headers and returns the response body as json.RawMessage. Returns an error if the request or response processing fails.
Types ¶
type RequestConfig ¶ added in v1.3.7
type RequestConfig struct {
Timeout time.Duration // Timeout specifies the maximum time for the entire request
MaxRetries int // MaxRetries specifies maximum retry attempts for failed requests
RetryDelay time.Duration // RetryDelay specifies the delay between retry attempts
}
RequestConfig holds configuration parameters for HTTP requests. This struct centralizes all request settings for better maintainability.
func LoadConfig ¶ added in v1.3.7
func LoadConfig() RequestConfig
LoadConfig loads request configuration with defaults. Returns a RequestConfig struct with default values.