PerformanceIMMO/elm-utils/5.3.1

NOTE: the latest version is 5.5.0

Renamed to SquirclesIO/elm-utils. It is published under that name, and new versions come out there.

Versions published as PerformanceIMMO/elm-utils still install under that name. 24 versions of 25 come from the new location (see their notes). 1 version could not be recovered and cannot be installed.

Unavailable. Nobody can download this version any more, with elm or with the Lamdera compiler: github.com/SquirclesIO/elm-utils exists but has no tag 5.3.1; Software Heritage not asked yet (this run's --swh-calls were used up); no fork with tag 5.3.1 found (7 same-name repos checked); no cached copy. Use another version.

Details

Perfimmo.Http.HttpRequest

HttpRequest

Types

type Request a
= Get String (Expect a)
| Delete String (Expect a)
| Post String Body (Expect a)
| Put String Body (Expect a)
| Patch String Body (Expect a)

Request

= BodyResponse Metadata a

BodyResponse

type HttpError e
= TechnicalError String
| DomainError (BodyResponse e)

HttpError

type alias HttpResult e a =
Result (HttpError e) (BodyResponse a)

HttpResult

type alias ResponseDecoder e a =
{ koDecoder : Decoder e
, okDecoder : Decoder a
}

ResponseDecoder

Functions

withAuthReq : Request a -> Cmd a

withAuthReq

request : RestNavigationLink -> Body -> Expect a -> Request a

request

authRequest : RestNavigationLink -> Body -> Expect a -> Cmd a

authRequest

withAuthReqWithHeaders : List Header -> Request a -> Cmd a

withAuthReqWithHeaders

Helper

printHttpError : Error -> String

printHttpError

Expect

expectJsonResponse : (Result Error ( Metadata, a ) -> msg) -> Decoder a -> Expect msg

expectJsonResponse

expectWhateverResponse : (Result Error Metadata -> msg) -> Expect msg

expectWhateverResponse

expectJsonResponse2 : (HttpResult e a -> msg) -> ResponseDecoder e a -> Expect msg

expectJsonResponse2

expectWhateverOkResult : (HttpResult e () -> msg) -> Decoder e -> Expect msg

expectWhateverOkResult

Transformations

bool2Uri : Bool -> String

bool2Uri