The generated code also adds it, causing application/json to appear twice in the Content-Type header. This causes servant to reject the request with 415: Unsupported Media Type
This problem had me going in circles for almost ~2 hours until I found this issue by googling. Some sample code would be much appreciated by Elm and HTTP API noobs like me.
It looks like
Http
already addsContent-Type: application/json
when using jsonBody:https://github.com/elm-lang/http/blob/99c00a2dac21dda1d4954515c79e6f28e431573f/src/Http.elm#L287-L292
The generated code also adds it, causing application/json to appear twice in the
Content-Type
header. This causes servant to reject the request with415: Unsupported Media Type
My current workaround: