|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Body
The Body interface is used to represent the body of
a HTTP entity. It contains the information that is delivered with
the request. The body is represented by a stream of bytes. In
order to access the entity body this interface provides a stream
which can be used to read it. Also, should the message be encoded
as a multipart message the individual parts can be read using the
Attachment instance for it.
| Method Summary | |
|---|---|
String |
getContent()
This will acquire the contents of the body in UTF-8. |
String |
getContent(String charset)
This will acquire the contents of the body in the specified charset. |
InputStream |
getInputStream()
This is used to acquire the contents of the body as a stream. |
Part |
getPart(String name)
This method is used to acquire a Part from the
HTTP request using a known name for the part. |
List<Part> |
getParts()
This method is used to get all Part objects that
are associated with the request. |
| Method Detail |
|---|
String getContent()
throws IOException
IOException
String getContent(String charset)
throws IOException
IOException
InputStream getInputStream()
throws IOException
IOExceptionPart getPart(String name)
Part from the
HTTP request using a known name for the part. This is typically
used when there is a file upload with a multipart POST request.
All parts that are not files can be acquired as string values
from the attachment object.
name - this is the name of the part object to acquire
List<Part> getParts()
Part objects that
are associated with the request. Each attachment contains the
body and headers associated with it. If the request is not a
multipart POST request then this will return an empty list.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||