Package org.dmfs.httpessentials.client
Interface HttpRequestEntity
public interface HttpRequestEntity
Defines an interface of an HTTP message request body entity.
-
Method Summary
Modifier and TypeMethodDescriptionorg.dmfs.jems.optional.Optional<Long>Returns the length of the content, if known.org.dmfs.jems.optional.Optional<MediaType>Returns theMediaTypeof the entity, if known.voidwriteContent(OutputStream out) Writes the content to the givenOutputStream.
-
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.
-
writeContent
Writes the content to the givenOutputStream. Note that the stream is property of the caller and must not be closed by this method.- Parameters:
out- TheOutputStreamto write to.- Throws:
IOException
-