Interface HttpContent (1.45.1)

public interface HttpContent extends StreamingContent

Serializes HTTP request content into an output stream.

Implementations don't need to be thread-safe.

Implements

StreamingContent

Methods

getLength()

public abstract long getLength()

Returns the content length or less than zero if not known.

Returns
Type Description
long
Exceptions
Type Description
IOException

getType()

public abstract String getType()

Returns the content type or null for none.

Returns
Type Description
String

retrySupported()

public abstract boolean retrySupported()

Returns whether or not retry is supported on this content type.

Returns
Type Description
boolean

writeTo(OutputStream out)

public abstract void writeTo(OutputStream out)

Writes the byte content to the given output stream.

Implementations must not close the output stream, and instead should flush the output stream. Some callers may assume that the output stream has not been closed, and will fail to work if it has been closed.

Parameter
Name Description
out OutputStream
Exceptions
Type Description
IOException