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 null
mimeType
- the MIME type, not null
charset
- the character set, may be null
, in which case the US-ASCII charset is usedUnsupportedEncodingException
IllegalArgumentException
- if the text
parameter is null@Deprecated public StringBody(String text, Charset charset) throws UnsupportedEncodingException
text
- to be used for the body, not null
charset
- the character set, may be null
, in which case the US-ASCII charset is usedUnsupportedEncodingException
IllegalArgumentException
- if the text
parameter is null@Deprecated public StringBody(String text) throws UnsupportedEncodingException
text
- to be used for the body, not null
UnsupportedEncodingException
IllegalArgumentException
- 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
IllegalArgumentException
public Reader getReader()
public void writeTo(OutputStream out) throws IOException
IOException
public String getTransferEncoding()
ContentDescriptor
public long getContentLength()
ContentDescriptor
public String getFilename()
Copyright © 1999–2022 The Apache Software Foundation. All rights reserved.