public class StringRequestEntity extends Object implements RequestEntity
| 构造器和说明 |
|---|
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.
|
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
public StringRequestEntity(String content)
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.
This constructor may be deprecated or changed to use the default HTTP content charset (ISO-8859-1) in the release 3.1
It is strongly recommended to use
StringRequestEntity(String, String, String) constructor
instead.
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.UnsupportedEncodingExceptionpublic String getContentType()
RequestEntitygetContentType 在接口中 RequestEntitycom.ptteng.mall.order.util.apacheCommonUtil.httpclient.HttpMethod#setRequestHeader(String, String)public boolean isRepeatable()
RequestEntityRequestEntity.writeRequest(OutputStream) can be called more than once.isRepeatable 在接口中 RequestEntitytruepublic void writeRequest(OutputStream out) throws IOException
RequestEntitywriteRequest 在接口中 RequestEntityIOExceptionpublic long getContentLength()
RequestEntitycom.ptteng.mall.order.util.apacheCommonUtil.httpclient.methods.EntityEnclosingMethod will use chunk encoding to
transmit the request entity.getContentLength 在接口中 RequestEntitypublic String getContent()
public String getCharset()
null if
no charset as been specified.Copyright © 2017. All rights reserved.