org.apache.commons.httpclient.methods
Class StringRequestEntity
- RequestEntity
public class StringRequestEntity
A RequestEntity that contains a String.
- 3.0
StringRequestEntity(String content) - Creates a new entity with the given content
|
StringRequestEntity(String content, String contentType, String charset) - Creates a new entity with the given content, content type, and charset.
|
StringRequestEntity
public StringRequestEntity(String content)
Creates a new entity with the given content
content
- The content to set.
StringRequestEntity
public StringRequestEntity(String content,
String contentType,
String charset)
throws UnsupportedEncodingException
Creates a new entity with the given content, content type, and charset.
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.
getCharset
public String getCharset()
- Returns the charset used to convert the content to bytes.
null
if
no charset as been specified.
getContent
public String getContent()
- Returns the content.
writeRequest
public void writeRequest(OutputStream out)
throws IOException
Writes the request entity to the given stream.
- writeRequest in interface RequestEntity
out
-
Copyright (c) 1999-2005 - Apache Software Foundation