mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-19 18:47:03 +00:00
ui: Upgrade to elm/http 2.0.0
This commit is contained in:
@@ -3,29 +3,29 @@ module HttpUtil exposing (delete, errorString, patch)
|
||||
import Http
|
||||
|
||||
|
||||
delete : String -> Http.Request ()
|
||||
delete url =
|
||||
delete : (Result Http.Error () -> msg) -> String -> Cmd msg
|
||||
delete msg url =
|
||||
Http.request
|
||||
{ method = "DELETE"
|
||||
, headers = []
|
||||
, url = url
|
||||
, body = Http.emptyBody
|
||||
, expect = Http.expectStringResponse (\_ -> Ok ())
|
||||
, expect = Http.expectWhatever msg
|
||||
, timeout = Nothing
|
||||
, withCredentials = False
|
||||
, tracker = Nothing
|
||||
}
|
||||
|
||||
|
||||
patch : String -> Http.Body -> Http.Request ()
|
||||
patch url body =
|
||||
patch : (Result Http.Error () -> msg) -> String -> Http.Body -> Cmd msg
|
||||
patch msg url body =
|
||||
Http.request
|
||||
{ method = "PATCH"
|
||||
, headers = []
|
||||
, url = url
|
||||
, body = body
|
||||
, expect = Http.expectStringResponse (\_ -> Ok ())
|
||||
, expect = Http.expectWhatever msg
|
||||
, timeout = Nothing
|
||||
, withCredentials = False
|
||||
, tracker = Nothing
|
||||
}
|
||||
|
||||
|
||||
@@ -42,11 +42,7 @@ errorString error =
|
||||
"HTTP Network error"
|
||||
|
||||
Http.BadStatus res ->
|
||||
"Bad HTTP status: " ++ String.fromInt res.status.code
|
||||
"Bad HTTP status: " ++ String.fromInt res
|
||||
|
||||
Http.BadPayload msg res ->
|
||||
"Bad HTTP payload: "
|
||||
++ msg
|
||||
++ " ("
|
||||
++ String.fromInt res.status.code
|
||||
++ ")"
|
||||
Http.BadBody msg ->
|
||||
"Bad HTTP body: " ++ msg
|
||||
|
||||
Reference in New Issue
Block a user