BaseBodyParser Class
Provides function to construct the structure needed to display the navigation in the Admin section of the application.
Constructor
BaseBodyParser
()
Item Index
Methods
- getcontentEncoding static
- getRawData
- parse
Properties
- CHARSET_HEADER_PREFIX static
- ENCODING_MAPPING static
Methods
getcontentEncoding
(
String
static
-
req
Attempts to extract charset attribute from the content-type header.
Parameters:
-
req
Request
Returns:
String:
the charset encoding
getRawData
(
-
cb
Retrieves the raw payload data as a string
Parameters:
-
cb
Function
parse
(
-
The
-
A
Attempts to retrieve the payload body as a string
Parameters:
-
The
Requestincoming request whose payload should be parsed
-
A
Functioncallback that taks two parameters: An Error, if occurred and the parsed body content as an object
Properties
CHARSET_HEADER_PREFIX
String
private
static
The prefix in the content-type header that indicates the charset used in the encoding
ENCODING_MAPPING
Object
private
static
A mapping that converts the HTTP standard for content-type encoding and what the Buffer prototype expects