hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Speirs <bill.spe...@gmail.com>
Subject ContentType Constants
Date Thu, 25 Aug 2011 19:21:34 GMT
I just pulled in the fluent-hc code and noticed there was a
ContentType class:
fluent-hc/src/main/java/org/apache/http/client/fluent/header/ContentType.java.
This class defines a handful of constants: HTML, JPEG, PNG, GIF, TEXT,
XML, and JSON.

There is already a ContentType class in the core code:
httpcore/src/main/java/org/apache/http/entity/ContentType.java.
However, this class does not define any constants.

Finally, there is a MediaType class in javax.ws.rs.core. It defines a
number of constants as well.

All of this, I believe, causes a bit of confusion when I need to
specify a Content Type. Which class should I be using?

I see 2 options:

1) Scrap the ContentType class in fluent-hc, keep the one in httpcore,
and make a note in the JavaDocs of httpcore that if you want constants
please use javax.ws.rs.core.MediaType.
2) Scrap the ContentType class in fluent-hc, keep the one in httpcore,
pull all of the types in MediaType into the ContentType class in
httpcore

Thoughts?

Bill-

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message