public abstract class HttpEntity extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
HttpEntity.Chunked
A chunked entity, backed by a source of chunks.
|
static class |
HttpEntity.Streamed
A streamed entity, backed by a source.
|
static class |
HttpEntity.Strict
A strict entity, where all the data for it is in memory.
|
| Modifier and Type | Field and Description |
|---|---|
static HttpEntity |
NO_ENTITY
No entity.
|
| Modifier and Type | Method and Description |
|---|---|
abstract HttpEntity |
as(String contentType) |
abstract play.api.http.HttpEntity |
asScala() |
static HttpEntity |
chunked(Source<ByteString,?> data,
Optional<String> contentType)
Convert the given source of ByteStrings to a chunked entity.
|
CompletionStage<ByteString> |
consumeData(Materializer mat)
Consumes the data.
|
abstract Optional<Long> |
contentLength() |
abstract Optional<String> |
contentType() |
abstract Source<ByteString,?> |
dataStream() |
static HttpEntity |
fromContent(play.twirl.api.Content content,
String charset)
Create an entity from the given content.
|
static HttpEntity |
fromString(String content,
String charset)
Create an entity from the given String.
|
abstract boolean |
isKnownEmpty() |
public static final HttpEntity NO_ENTITY
public abstract boolean isKnownEmpty()
public abstract Source<ByteString,?> dataStream()
public abstract HttpEntity as(String contentType)
contentType - the content type to use, i.e. "text/html".public CompletionStage<ByteString> consumeData(Materializer mat)
mat - the application's materializer.public abstract play.api.http.HttpEntity asScala()
public static final HttpEntity fromContent(play.twirl.api.Content content, String charset)
content - The content.charset - The charset.public static final HttpEntity fromString(String content, String charset)
content - The content.charset - The charset.public static final HttpEntity chunked(Source<ByteString,?> data, Optional<String> contentType)
data - The source.contentType - The optional content type.