Net.Https
eff HttpsSourceThe effect used to send HTTPS-only requests.
Operations
Definitions
Sends a DELETE request to the given url.
Sends a GET request to the given url.
Handles the Https effect of the given function f.
Re-interprets the Https effect using the IO effect.
Validates that request URLs use the https:// scheme.
Sends a HEAD request to the given url.
Sends an OPTIONS request to the given url.
Sends a PATCH request to the given url with the given body.
Sends a POST request to the given url with the given body.
Sends a PUT request to the given url with the given body.
@DefaultHandler Runs the Https effect of the given function f.
Re-interprets the Https effect using the IO effect.
Sends the given request req via the Https effect.
Middleware that intercepts the Https effect, prepending base to
request URLs that do not already start with a scheme. Absolute URLs
(where "://" appears before the first "/") are left unchanged.
def withCircuitBreaker(ft: { failureThreshold = Int32 }, cdm: { cooldown = Duration }, f: Unit -> a \ ef): a \ (ef - Https) + Clock + Https§ SourceMiddleware that intercepts the Https effect, implementing a circuit breaker.
Tracks consecutive failures (transport errors and 5xx server errors).
After failureThreshold consecutive failures, the circuit opens and
immediately rejects requests for cooldown.
After the cooldown, one probe request is allowed through (half-open state).
A successful probe closes the circuit; a failed probe restarts the cooldown.
Non-failure responses (2xx, 3xx, 4xx) reset the failure counter.
def withDefaultHeaders(defaults: Map[String, List[String]], f: Unit -> a \ ef): a \ (ef - Https) + Https§ SourceMiddleware that intercepts the Https effect, injecting default headers
into every request. Headers already present on the request are not overridden.
Middleware that intercepts the Https effect, logging each request
and its corresponding response via the Logger effect at Debug level.
def withMinInterval(ims: { interval = Duration }, f: Unit -> a \ ef): a \ (ef - Https) + Clock + Https§ SourceMiddleware that intercepts the Https effect, enforcing a minimum interval
between consecutive HTTPS requests.
def withRetry(strategy: Int32 -> (HttpRequest -> (RetryOutcome -> RetryDecision \ ef1)), f: Unit -> a \ ef2): a \ ef1 + (ef2 - Https) + Https§ SourceMiddleware that intercepts the Https effect, adding retry logic.
The strategy function decides whether to retry and how long to wait.
Validates the https:// scheme once before entering the retry loop.
Each Https.request is re-raised to an outer Https handler that performs the actual I/O.
def withSlidingWindow(mr: { maxRequests = Int32 }, wms: { window = Duration }, f: Unit -> a \ ef): a \ (ef - Https) + Clock + Https§ SourceMiddleware that intercepts the Https effect, enforcing a sliding-window
rate limit. Allows at most maxRequests within any rolling window.
When the limit is reached, sleeps until the oldest request expires.
def withTokenBucket(bs: { burstSize = Int32 }, ims: { interval = Duration }, f: Unit -> a \ ef): a \ (ef - Https) + Clock + Https§ SourceMiddleware that intercepts the Https effect, enforcing a token-bucket
rate limit. Allows an initial burst of burstSize requests, then
sustains at 1 request per interval.