Found out that Http.post sends it as 'text/plain' mime, not as 
'application/json'. Strange, since it expects a JSON response.

Is there a way to force that?

Op zaterdag 2 juli 2016 00:21:58 UTC+2 schreef Dirk Vaneynde:
>
> Hi, I try to post some json via ELM to a java server with jax-rs, 
> consuming application/json.
>
> It works fine using curl: 
>
> curl -vH "Content-Type: application/json" -X POST -d '{"robotOn": true}' 
> http://localhost:8080/domo/screenRobotUpdate
>
> But it returns 415 error code when using the following simple elm code:
>
> updateInfo: Model -> Task Http.Error String
> updateInfo model =
>   *Http.post Json.Decode.string urlPost (Http.string """{"robotOn": 
> false}""")*
>
> I'm already in a bad mood since Belgium lost to Wales, so help is 
> appreciated :)
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to