serializerFor<T> method

Serializer<T> serializerFor <T>(
  1. Type type,
  2. {String mimeType}
)

Returns serializer for given object type and mimeType.

If mimeType is null, the mime type of request is used.

Implementation

Serializer<T> serializerFor<T>(Type type, {String mimeType}) {
  final codec = _serializers[mimeType ?? this.mimeType.mimeType];
  if (codec == null) return null;
  final ser = codec.getByType<T>(type ?? T);
  return ser;
}