servant-elm-0.6.1: test/elm-sources/getOneWithDynamicUrlSource.elm
module GetOneWithDynamicUrlSource exposing (..)
import Http
import Url.Builder
import Json.Decode exposing (..)
getOne : String -> (Result Http.Error (Int) -> msg) -> Cmd msg
getOne urlBase toMsg =
let
params =
List.filterMap identity
(List.concat
[])
in
Http.request
{ method =
"GET"
, headers =
[]
, url =
Url.Builder.crossOrigin urlBase
[ "one"
]
params
, body =
Http.emptyBody
, expect =
Http.expectJson toMsg Json.Decode.int
, timeout =
Nothing
, tracker =
Nothing
}