public class StringBody extends AbstractContentBody
MultipartEntityBuilder| Constructor and Description |
|---|
StringBody(String text)
Deprecated.
(4.3) use
StringBody(String, ContentType)
or MultipartEntityBuilder |
StringBody(String text,
Charset charset)
Deprecated.
(4.3) use
StringBody(String, ContentType)
or MultipartEntityBuilder |
StringBody(String text,
org.apache.http.entity.ContentType contentType) |
StringBody(String text,
String mimeType,
Charset charset)
Deprecated.
(4.3) use
StringBody(String, ContentType)
or MultipartEntityBuilder |
| Modifier and Type | Method and Description |
|---|---|
static StringBody |
create(String text)
Deprecated.
(4.3) use
StringBody(String, ContentType)
or MultipartEntityBuilder |
static StringBody |
create(String text,
Charset charset)
Deprecated.
(4.3) use
StringBody(String, ContentType)
or MultipartEntityBuilder |
static StringBody |
create(String text,
String mimeType,
Charset charset)
Deprecated.
(4.3) use
StringBody(String, ContentType)
or MultipartEntityBuilder |
long |
getContentLength()
Returns the body descriptors content-length.
|
String |
getFilename() |
Reader |
getReader() |
String |
getTransferEncoding()
Returns the body descriptors transfer encoding.
|
void |
writeTo(OutputStream out) |
getCharset, getContentType, getMediaType, getMimeType, getSubType@Deprecated public StringBody(String text, String mimeType, Charset charset) throws UnsupportedEncodingException
text - to be used for the body, not nullmimeType - the MIME type, not nullcharset - the character set, may be null, in which case the US-ASCII charset is usedUnsupportedEncodingExceptionIllegalArgumentException - if the text parameter is null@Deprecated public StringBody(String text, Charset charset) throws UnsupportedEncodingException
text - to be used for the body, not nullcharset - the character set, may be null, in which case the US-ASCII charset is usedUnsupportedEncodingExceptionIllegalArgumentException - if the text parameter is null@Deprecated public StringBody(String text) throws UnsupportedEncodingException
text - to be used for the body, not nullUnsupportedEncodingExceptionIllegalArgumentException - if the text parameter is nullpublic StringBody(String text, org.apache.http.entity.ContentType contentType)
@Deprecated public static StringBody create(String text, String mimeType, Charset charset) throws IllegalArgumentException
IllegalArgumentException@Deprecated public static StringBody create(String text, Charset charset) throws IllegalArgumentException
IllegalArgumentException@Deprecated public static StringBody create(String text) throws IllegalArgumentException
IllegalArgumentExceptionpublic Reader getReader()
public void writeTo(OutputStream out) throws IOException
IOExceptionpublic String getTransferEncoding()
ContentDescriptorpublic long getContentLength()
ContentDescriptorpublic String getFilename()
Copyright © 1999–2022 The Apache Software Foundation. All rights reserved.