|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.httpclient.methods.StringRequestEntity
public class StringRequestEntity
A RequestEntity that contains a String.
Constructor Summary | |
---|---|
StringRequestEntity(String content)
Deprecated. use StringRequestEntity(String, String, String) instead |
|
StringRequestEntity(String content,
String contentType,
String charset)
Creates a new entity with the given content, content type, and charset. |
Method Summary | |
---|---|
String |
getCharset()
|
String |
getContent()
|
long |
getContentLength()
Gets the request entity's length. |
String |
getContentType()
Gets the entity's content type. |
boolean |
isRepeatable()
Tests if RequestEntity.writeRequest(OutputStream) can be called more than once. |
void |
writeRequest(OutputStream out)
Writes the request entity to the given stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StringRequestEntity(String content)
StringRequestEntity(String, String, String)
instead
Creates a new entity with the given content. This constructor will use the default platform charset to convert the content string and will provide no content type.
content
- The content to set.StringRequestEntity(String, String, String)
public StringRequestEntity(String content, String contentType, String charset) throws UnsupportedEncodingException
content
- The content to set.contentType
- The type of the content, or null
. The value retured
by getContentType()
. If this content type contains a charset and the charset
parameter is null, the content's type charset will be used.charset
- The charset of the content, or null
. Used to convert the
content to bytes. If the content type does not contain a charset and charset is not null,
then the charset will be appended to the content type.
UnsupportedEncodingException
Method Detail |
---|
public String getContentType()
RequestEntity
getContentType
in interface RequestEntity
HttpMethod.setRequestHeader(String, String)
public boolean isRepeatable()
RequestEntity
RequestEntity.writeRequest(OutputStream)
can be called more than once.
isRepeatable
in interface RequestEntity
true
public void writeRequest(OutputStream out) throws IOException
RequestEntity
writeRequest
in interface RequestEntity
IOException
public long getContentLength()
RequestEntity
EntityEnclosingMethod
will use chunk encoding to
transmit the request entity.
getContentLength
in interface RequestEntity
public String getContent()
public String getCharset()
null
if
no charset as been specified.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |