Skip to content

Commit 125cc72

Browse files
committed
Get string representation of javadsl Content and Media Type
1 parent 4fb8554 commit 125cc72

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎http-core/src/main/scala/org/apache/pekko/http/javadsl/model/ContentType.scala‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,10 @@ trait ContentType {
6161
* Returns the charset if this ContentType is non-binary.
6262
*/
6363
def getCharsetOption: Optional[HttpCharset]
64+
65+
/**
66+
* Returns the string representation of this ContentType
67+
* @since 1.2.0
68+
*/
69+
def value: String
6470
}

‎http-core/src/main/scala/org/apache/pekko/http/javadsl/model/MediaType.scala‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,10 @@ trait MediaType {
110110
* Creates a media-range from this media-type with a given qValue.
111111
*/
112112
def toRange(qValue: Float): MediaRange
113+
114+
/**
115+
* Returns the string representation of this MediaType
116+
* @since 1.2.0
117+
*/
118+
def value: String
113119
}

0 commit comments

Comments
 (0)