Class ByteArrayRequestEntity
java.lang.Object
org.apache.commons.httpclient.methods.ByteArrayRequestEntity
- All Implemented Interfaces:
RequestEntity
Deprecated.
Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
It is not recommended to use it in any new code.
Instead, use HTTP client API plugins as a dependency in your code.
E.g.
Apache HttpComponents Client API 4.x Plugin or
Async HTTP Client Plugin.
A RequestEntity that contains an array of bytes.
- Since:
- 3.0
-
Constructor Summary
ConstructorsConstructorDescriptionByteArrayRequestEntity
(byte[] content) Deprecated.Creates a new entity with the given content.ByteArrayRequestEntity
(byte[] content, String contentType) Deprecated.Creates a new entity with the given content and content type. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Deprecated.long
Deprecated.Gets the request entity's length.Deprecated.Gets the entity's content type.boolean
Deprecated.Tests ifRequestEntity.writeRequest(OutputStream)
can be called more than once.void
writeRequest
(OutputStream out) Deprecated.Writes the request entity to the given stream.
-
Constructor Details
-
ByteArrayRequestEntity
public ByteArrayRequestEntity(byte[] content) Deprecated.Creates a new entity with the given content.- Parameters:
content
- The content to set.
-
ByteArrayRequestEntity
Deprecated.Creates a new entity with the given content and content type.- Parameters:
content
- The content to set.contentType
- The content type to set ornull
.
-
-
Method Details
-
isRepeatable
public boolean isRepeatable()Deprecated.Description copied from interface:RequestEntity
Tests ifRequestEntity.writeRequest(OutputStream)
can be called more than once.- Specified by:
isRepeatable
in interfaceRequestEntity
- Returns:
true
-
getContentType
Deprecated.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 interfaceRequestEntity
- Returns:
- the entity's content type
- See Also:
-
writeRequest
Deprecated.Description copied from interface:RequestEntity
Writes the request entity to the given stream.- Specified by:
writeRequest
in interfaceRequestEntity
- Parameters:
out
-- Throws:
IOException
-
getContentLength
public long getContentLength()Deprecated.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 theEntityEnclosingMethod
will use chunk encoding to transmit the request entity.- Specified by:
getContentLength
in interfaceRequestEntity
- Returns:
- The length of the content.
-
getContent
public byte[] getContent()Deprecated.- Returns:
- Returns the content.
-