Serialize a data structure.
The format it is serialized to is determined automatically as described above.
It can be one of YAML,
XML,
JSON,
defaulting to JSON if there's no clear preference from the request.

Returns the content-type that was used during the last serialize / deserialize call.
WARNING : you must call serialize / deserialize before calling content_type.
Otherwise the return value will be undef.