添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
public StringRequestEntity ( String content)
Deprecated. use StringRequestEntity(String, String, String) instead

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.

Parameters:
content - The content to set.
See Also:
StringRequestEntity(String, String, String)
throws UnsupportedEncodingException
Creates a new entity with the given content, content type, and charset.
Parameters:
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.
Throws:
UnsupportedEncodingException
Description copied from interface: RequestEntity
Gets the entity's content type. This content type will be used as the value for the "Content-Type" header.
Specified by:
getContentType in interface RequestEntity
Returns:
the entity's content type
See Also:
HttpMethod.setRequestHeader(String, String)
Description copied from interface: RequestEntity
Tests if RequestEntity.writeRequest(OutputStream) can be called more than once.
Specified by:
isRepeatable in interface RequestEntity
Returns:
true
Description copied from interface: RequestEntity
Writes the request entity to the given stream.
Specified by:
writeRequest in interface RequestEntity
Throws:
IOException
Description copied from interface: RequestEntity
Gets the request entity's length. This method should return a non-negative value if the content length is known or a negative value if it is not. In the latter case the EntityEnclosingMethod will use chunk encoding to transmit the request entity.
Specified by:
getContentLength in interface RequestEntity
Returns:
The length of the content.