org.apache.commons.httpclient.methods
Interface RequestEntity

All Known Implementing Classes:
ByteArrayRequestEntity, InputStreamRequestEntity, MultipartRequestEntity, StringRequestEntity

public interface RequestEntity

Since:
3.0

Method Summary
 long getContentLength()
          Gets the request entity's length.
 java.lang.String getContentType()
          Gets the entity's content type.
 boolean isRepeatable()
          Tests if writeRequest(OutputStream) can be called more than once.
 void writeRequest(java.io.OutputStream out)
          Writes the request entity to the given stream.
 

Method Detail

isRepeatable

public boolean isRepeatable()
Tests if writeRequest(OutputStream) can be called more than once.

Returns:
true if the entity can be written to OutputStream more than once, false otherwise.

writeRequest

public void writeRequest(java.io.OutputStream out)
                  throws java.io.IOException
Writes the request entity to the given stream.

Parameters:
out -
Throws:
java.io.IOException

getContentLength

public long getContentLength()
Gets the request entity's length.

Returns:
either a number >= 0 or EntityEnclosingMethod.CONTENT_LENGTH_CHUNKED

getContentType

public java.lang.String getContentType()
Gets the entity's content type. This content type will be used as the value for the "Content-Type" header.

Returns:
the entity's content type
See Also:
HttpMethod.setRequestHeader(String, String)


Copyright (c) 1999-2005 - Apache Software Foundation