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

2016-06-24 Thread germain
} , Cmd.none ) PostFail errorMessage -> ( { model | error = (toString errorMessage) }, Cmd.none) Le mercredi 22 juin 2016 00:33:05 UTC+8, William Casarin a écrit : > > Hey germain, > > On Mon, Jun 20, 2016 at 11:23 PM, germain > wrote: > > IT&#x

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

2016-06-20 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 germain
type alias PostResponse = (Http.Response, Int) type alias Model = { error : String , response: String } type Msg = CreateSeat | PostSucceed PostResponse | PostFail Http.Error update : Msg -> Model -> (Model, Cmd Msg) update msg model = case msg of CreateSe

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

2016-06-16 Thread germain
model | response = (toString response) }, Cmd.none ) PostFail errorMessage -> ( { model | error = (toString errorMessage) }, Cmd.none) And then I got the same result, the value of the Http.Response only : UnexpectedPayload "Expecting an object with a field named `seatNo` but inst

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 o

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

2016-06-15 Thread germain
1/Http#Value> } Is it possible to retrieve the whole response, for example to retrieve the status and the value fields? Thanks, Germain. -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiv

Re: [elm-discuss] one message calls two messages

2016-05-26 Thread germain
Thanks ~ -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.

[elm-discuss] one message calls two messages

2016-05-26 Thread germain
stCounter, IncrementSecondCounter ]) IncrementFirstCounter -> ( { model | countFirst = model.countFirst + 1 }, Cmd.none) IncrementSecondCounter -> ( { model | countSecond = model.countSecond + 1 }, Cmd.none) Tks, Germain. -- You received this message because you are subscribe