WsContents
Overview
The WsContents
class represents the contents or parts of an HTTP request. It provides functionality to access metadata and content details of uploaded files or form data in a request. The contents include attributes such as the content name, field name, content type, size, and raw byte data. Additionally, it allows retrieval of the content as a string with a specified encoding.
Key methods include getName()
to get the content name, getFieldName()
to retrieve the field name, getContentType()
to access the MIME type, and getSize()
to get the content size in bytes. The class also provides methods like getBytes()
to obtain raw byte data and getString(encoding)
to convert the content into a string using a specified encoding.
Properties Summarized
Properties Detailed
bytes
Get contents bytes.
Type Array
Sample
contentType
Get contents content type.
Type String
Sample
fieldName
Get contents field name.
Type String
Sample
name
Get contents name.
Type String
Sample
size
Get contents size.
Type Number
Sample
string
Get contents as string.
Type String
Sample
Last updated