Re: [elm-discuss] http request: How to access the whole response

2016-06-24 Thread germain
Hi William, > The error type has to be "Maybe" because we could hit a network error > before we get a response > Yes,the Task.andThen error returned value could be with or without response! The compiler forces us to take into consideration both scenarios => the error returned value (what

Re: [elm-discuss] http request: How to access the whole response

2016-06-21 Thread germain
IT'S WORK, thank you so much William ~ BUT I HAVE A FEW MORE QUESTIONS: - Http.fromJson decoder (Task.succeed response) => why do you use (Task.succeed response) ? And not just give as argument "response"? Is it connected with `andThen` and its signature andThen

Re: [elm-discuss] http request: How to access the whole response

2016-06-16 Thread William Casarin
Hey germain, On Thu, Jun 16, 2016 at 9:52 AM, germain wrote: > > HOWEVER I just get the value field of the response and nothing else > > UnexpectedPayload "Expecting an object with a field named `fakeInt` but > instead got:

Re: [elm-discuss] http request: How to access the whole response

2016-06-16 Thread germain
post' : String -> Http.Body -> Task.Task RawError Http.Responsepost' url body =Http.send Http.defaultSettings{ verb = "POST", headers =[ ("Content-type", "application/json")], url = url, body = body} promoteError : RawError -> ErrorpromoteError rawError = case rawError

Re: [elm-discuss] http request: How to access the whole response

2016-06-16 Thread germain
post' : String -> Http.Body -> Task.Task RawError Http.Responsepost' url body =Http.send Http.defaultSettings{ verb = "POST", headers =[ ("Content-type", "application/json")], url = url, body = body} promoteError : RawError -> ErrorpromoteError rawError = case rawError

[elm-discuss] http request: How to access the whole response

2016-06-15 Thread germain
Hello, To make a request, I chain: send : Settings -> Request -> Task