Package org.dmfs.httpessentials.client
Interface HttpResponseEntity
public interface HttpResponseEntity
Defines an interface of an HTTP response message body entity.
-
Method Summary
Modifier and TypeMethodDescriptionorg.dmfs.jems.optional.Optional<Long>Returns the length of the content, if known.Returns the contentInputStreamof the entity.org.dmfs.jems.optional.Optional<MediaType>Returns theMediaTypeof the entity, if known.
-
Method Details
-
contentType
org.dmfs.jems.optional.Optional<MediaType> contentType()Returns theMediaTypeof the entity, if known.- Returns:
- The
OptionalcontentMediaType.
-
contentLength
org.dmfs.jems.optional.Optional<Long> contentLength()Returns the length of the content, if known.- Returns:
- The
Optionalcontent length.
-
contentStream
Returns the contentInputStreamof the entity. If you don't consume the entire content, make sure you always close theInputStream.- Returns:
- An
InputStream. - Throws:
IOException- If an IO error occurred.
-