playframework/playframework — pull request #3238 by julienrf (2014-07-30 15:53:10+00:00)
Title: Don’t use ContentTypeOf in play-ws

Actually, I think `ContentTypeOf` should be deprecated because it is redundant with `Writeable`. However, removing it is a hard work. In the meanwhile, we should minimize our dependencies to it. This PR does just this for play-ws.

Please tell me if you agree with me that we should remove `ContentTypeOf`. A major issue is that we probably can not do it in a source compatible way. Indeed, the current design of `Writeable[A]` makes it impossible to retrieve the content type directly from the `A`. If it was the case, then we could get rid of `ContentTypeOf` [here](https://github.com/playframework/playframework/blob/master/framework/src/play/src/main/scala/play/api/http/Writeable.scala#L49-L51).

`ContentTypeOf` probably does no harm, but I keep thinking we should prevent potential harm by keeping the code simple and clean. Currently the way to set the content type of a result is scattered in at least three places in the code (`Writeable`, `ContentTypeOf` and some other place to bridge with the Java API). We should try to have just one place for such a thing.