Interface for marshallers that are used to parse HTTP request and serialize
HTTP response payloads given the content type.
Methods
-
deserialize(data, contentType)
-
Deserialize the specified buffer into an object.
Parameters:
Name Type Description dataexternal:Buffer Binary data to deserialize. contentTypestring Content type (may have optional charset argument). Throws:
-
If the binary data is invalid and cannot be deserialized.
Returns:
The deserialized object.- Type
- Object
-
-
serialize(obj, contentType)
-
Serialize the specified object for sending it in an HTTP response.
Parameters:
Name Type Description objObject Object to serialize. contentTypestring Content type (may have optional charset argument). Returns:
Serialized data.- Type
- external:Buffer