public class StringBody extends AbstractContentBody
MultipartEntityBuilder
Modifier and Type | Field and Description |
---|---|
private byte[] |
content |
Constructor and Description |
---|
StringBody(java.lang.String text)
Deprecated.
(4.3) use
StringBody(String, ContentType)
or MultipartEntityBuilder |
StringBody(java.lang.String text,
java.nio.charset.Charset charset)
Deprecated.
(4.3) use
StringBody(String, ContentType)
or MultipartEntityBuilder |
StringBody(java.lang.String text,
org.apache.http.entity.ContentType contentType) |
StringBody(java.lang.String text,
java.lang.String mimeType,
java.nio.charset.Charset charset)
Deprecated.
(4.3) use
StringBody(String, ContentType)
or MultipartEntityBuilder |
Modifier and Type | Method and Description |
---|---|
static StringBody |
create(java.lang.String text)
Deprecated.
(4.3) use
StringBody(String, ContentType)
or MultipartEntityBuilder |
static StringBody |
create(java.lang.String text,
java.nio.charset.Charset charset)
Deprecated.
(4.3) use
StringBody(String, ContentType)
or MultipartEntityBuilder |
static StringBody |
create(java.lang.String text,
java.lang.String mimeType,
java.nio.charset.Charset charset)
Deprecated.
(4.3) use
StringBody(String, ContentType)
or MultipartEntityBuilder |
long |
getContentLength()
Returns the body descriptors content-length.
|
java.lang.String |
getFilename() |
java.io.Reader |
getReader() |
java.lang.String |
getTransferEncoding()
Returns the body descriptors transfer encoding.
|
void |
writeTo(java.io.OutputStream out) |
getCharset, getContentType, getMediaType, getMimeType, getSubType
@Deprecated public StringBody(java.lang.String text, java.lang.String mimeType, java.nio.charset.Charset charset) throws java.io.UnsupportedEncodingException
StringBody(String, ContentType)
or MultipartEntityBuilder
text
- to be used for the body, not null
mimeType
- the MIME type, not null
charset
- the character set, may be null
, in which case the US-ASCII charset is usedjava.io.UnsupportedEncodingException
java.lang.IllegalArgumentException
- if the text
parameter is null@Deprecated public StringBody(java.lang.String text, java.nio.charset.Charset charset) throws java.io.UnsupportedEncodingException
StringBody(String, ContentType)
or MultipartEntityBuilder
text
- to be used for the body, not null
charset
- the character set, may be null
, in which case the US-ASCII charset is usedjava.io.UnsupportedEncodingException
java.lang.IllegalArgumentException
- if the text
parameter is null@Deprecated public StringBody(java.lang.String text) throws java.io.UnsupportedEncodingException
StringBody(String, ContentType)
or MultipartEntityBuilder
text
- to be used for the body, not null
java.io.UnsupportedEncodingException
java.lang.IllegalArgumentException
- if the text
parameter is nullpublic StringBody(java.lang.String text, org.apache.http.entity.ContentType contentType)
@Deprecated public static StringBody create(java.lang.String text, java.lang.String mimeType, java.nio.charset.Charset charset) throws java.lang.IllegalArgumentException
StringBody(String, ContentType)
or MultipartEntityBuilder
java.lang.IllegalArgumentException
@Deprecated public static StringBody create(java.lang.String text, java.nio.charset.Charset charset) throws java.lang.IllegalArgumentException
StringBody(String, ContentType)
or MultipartEntityBuilder
java.lang.IllegalArgumentException
@Deprecated public static StringBody create(java.lang.String text) throws java.lang.IllegalArgumentException
StringBody(String, ContentType)
or MultipartEntityBuilder
java.lang.IllegalArgumentException
public java.io.Reader getReader()
public void writeTo(java.io.OutputStream out) throws java.io.IOException
java.io.IOException
public java.lang.String getTransferEncoding()
ContentDescriptor
public long getContentLength()
ContentDescriptor
public java.lang.String getFilename()