There are a type and a task
type Msg
= Fail String
| Success (Int, Int)
makeRequest =
let
req =
{ verb = "GET"
, headers = []
, url = "http://localhost:8080"
, body = empty
}
in
Task.perform Fail Success <| send defaultSettings req
The argument of Fail
constructor is for error message (just "Error"
), first argument of Succeess
is for status
from Http.Response
, second is for size of value
from Http.Response
.
How to convert Task Http.RawError Http.Response
to Task String (Int, Int)
?
I'm looking at Task.map
and Tsk.mapError
and I don't understand how to combine them. Am I on a right way?