Can't override `Content-Type` once it's set
When the body of a request is set the Content-Type header is derived from the actual payload.
Once set, the Content-Type can't be overriden.
See https://github.com/playframework/play-ws/commit/b7059c90a504335723c8e7c6621ffece2b792fa1#diff-4314f1bc7ecca562239ccbdaf002c36cR77
This is preventing advanced users from managing the serialization themselves, then provide (e.g.) a ByteString and finally set the the Content-Type manually.
That is the case of Lagom.
This is because withBody also sets the content type, and there were issues with content-type being set out of order.
So the original rationale was repeated content types:
- Repeated content type headers in WS on POST
- PR: https://github.com/playframework/playframework/pull/5477
And then there's been reworking of the logic when handling typed bodies with content types.