data AJAX :: !The effect type for AJAX requests made with Affjax.
type Affjax e a = Aff (ajax :: AJAX | e) (AffjaxResponse a)The type for Affjax requests.
type AffjaxRequest a = { method :: Method, url :: URL, headers :: Array RequestHeader, content :: Maybe a, username :: Maybe String, password :: Maybe String }defaultRequest :: AffjaxRequest Unittype AffjaxResponse a = { status :: StatusCode, headers :: Array ResponseHeader, response :: a }The type of records that will be received as an Affjax response.
type URL = StringType alias for URL strings to aid readability of types.
affjax :: forall e a b. (Requestable a, Respondable b) => AffjaxRequest a -> Affjax e bMakes an Affjax request.
get :: forall e a. (Respondable a) => URL -> Affjax e aMakes a GET request to the specified URL.
post :: forall e a b. (Requestable a, Respondable b) => URL -> a -> Affjax e bMakes a POST request to the specified URL, sending data.
post' :: forall e a b. (Requestable a, Respondable b) => URL -> Maybe a -> Affjax e bMakes a POST request to the specified URL with the option to send data.
post_ :: forall e a. (Requestable a) => URL -> a -> Affjax e UnitMakes a POST request to the specified URL, sending data and ignoring the
response.
post_' :: forall e a. (Requestable a) => URL -> Maybe a -> Affjax e UnitMakes a POST request to the specified URL with the option to send data,
and ignores the response.
put :: forall e a b. (Requestable a, Respondable b) => URL -> a -> Affjax e bMakes a PUT request to the specified URL, sending data.
put' :: forall e a b. (Requestable a, Respondable b) => URL -> Maybe a -> Affjax e bMakes a PUT request to the specified URL with the option to send data.
put_ :: forall e a. (Requestable a) => URL -> a -> Affjax e UnitMakes a PUT request to the specified URL, sending data and ignoring the
response.
put_' :: forall e a. (Requestable a) => URL -> Maybe a -> Affjax e UnitMakes a PUT request to the specified URL with the option to send data,
and ignores the response.
delete :: forall e a. (Respondable a) => URL -> Affjax e aMakes a DELETE request to the specified URL.
delete_ :: forall e. URL -> Affjax e UnitMakes a DELETE request to the specified URL and ignores the response.
type RetryDelayCurve = Int -> IntA sequence of retry delays, in milliseconds.
type RetryPolicy = { timeout :: Maybe Int, delayCurve :: RetryDelayCurve, shouldRetryWithStatusCode :: StatusCode -> Boolean }Expresses a policy for retrying Affjax requests with backoff.
defaultRetryPolicy :: RetryPolicyA sensible default for retries: no timeout, maximum delay of 30s, initial delay of 0.1s, exponential backoff, and no status code triggers a retry.
retry :: forall e a b. (Requestable a) => RetryPolicy -> (AffjaxRequest a -> Affjax (avar :: AVAR, ref :: REF | e) b) -> AffjaxRequest a -> Affjax (avar :: AVAR, ref :: REF | e) bRetry a request using a RetryPolicy. After the timeout, the last received response is returned; if it was not possible to communicate with the server due to an error, then this is bubbled up.
affjax' :: forall e a b. (Requestable a, Respondable b) => AffjaxRequest a -> (Error -> Eff (ajax :: AJAX | e) Unit) -> (AffjaxResponse b -> Eff (ajax :: AJAX | e) Unit) -> Eff (ajax :: AJAX | e) (Canceler (ajax :: AJAX | e))Run a request directly without using Aff.