From 6a0c5087f716ed6c876a666db6573491bfd3e094 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 12 Jun 2016 23:54:17 +0200 Subject: Design income form --- src/client/elm/Utils/Http.elm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/client/elm/Utils/Http.elm') diff --git a/src/client/elm/Utils/Http.elm b/src/client/elm/Utils/Http.elm index 97db053..9bcfad7 100644 --- a/src/client/elm/Utils/Http.elm +++ b/src/client/elm/Utils/Http.elm @@ -1,5 +1,6 @@ module Utils.Http exposing ( post + , postWithBody , delete , decodeHttpValue , errorKey @@ -10,17 +11,20 @@ import Task exposing (..) import Json.Decode as Json exposing (Decoder) post : String -> Task Error Value -post = request "POST" +post url = postWithBody url empty + +postWithBody : String -> Body -> Task Error Value +postWithBody = request "POST" delete : String -> Task Error Value -delete = request "DELETE" +delete url = request "DELETE" url empty -request : String -> String -> Task Error Value -request method url = +request : String -> String -> Body -> Task Error Value +request method url body = { verb = method , headers = [] , url = url - , body = empty + , body = body } |> Http.send defaultSettings |> mapError promoteError -- cgit v1.2.3