public interface Message extends Closeable
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes all resources associated with the entity.
|
Entity |
getEntity()
Returns the entity.
|
Headers |
getHeaders()
Returns the headers.
|
String |
getVersion()
Returns the protocol version.
|
Message |
setEntity(Object o)
Sets the content of the entity to the provided value.
|
Message |
setVersion(String version)
Sets the protocol version.
|
Headers getHeaders()
String getVersion()
HTTP/1.1
.Message setEntity(Object o)
Content-Length
header, overwriting any existing header.
This method is intended mostly as a convenience method within scripts. The parameter will be handled depending on its type as follows:
BranchingInputStream
- equivalent to calling
Entity.setRawContentInputStream(org.forgerock.http.io.BranchingInputStream)
byte[]
- equivalent to calling Entity.setBytes(byte[])
String
- equivalent to calling Entity.setString(java.lang.String)
Object
- equivalent to calling Entity.setJson(java.lang.Object)
.
Note: This method does not attempt to encode the entity based-on any
codings specified in the Content-Encoding
header.
o
- The object whose value should be stored in the entity.Message setVersion(String version)
HTTP/1.1
.version
- The protocol version.void close()
close
in interface AutoCloseable
close
in interface Closeable
Entity.close()
Copyright 2011-2015 ForgeRock AS.