packages feed

servant-elm-0.3.0.0: test/elm-sources/getBooksByIdSource.elm

module GetBooksByIdSource exposing (..)

import Http


getBooksById : Int -> Http.Request (Book)
getBooksById id =
    Http.request
        { method =
            "GET"
        , headers =
            []
        , url =
            String.join "/"
                [ ""
                , "books"
                , id |> toString |> Http.encodeUri
                ]
        , body =
            Http.emptyBody
        , expect =
            Http.expectJson decodeBook
        , timeout =
            Nothing
        , withCredentials =
            False
        }