using System.Net.Http.Formatting;
using EasyApi.Http.MediaTypes;
using EasyApi.Utils;

namespace EasyApi.Formatting
{
	public class FormUrlEncodedMediaTypeFormatterSelector : SingleMediaTypeFormatterSelector
	{
		protected override MediaTypeFormatter GetFormatter(MediaTypeFormatterCollection formatters)
		{
			Argument.IsNotNull(formatters, nameof(formatters));

			return formatters.FormUrlEncodedFormatter ?? DefaultMediaTypeFormatters.FormUrlEncoded();
		}
	}
}