using System;
using System.Collections.Specialized;
using System.Threading.Tasks;
namespace EmbedIO.WebApi
{
///
/// Specifies that a parameter of a controller method will receive a
/// of HTML form data, obtained by deserializing a request body with a content type
/// of application/x-www-form-urlencoded.
/// The received collection will be read-only.
/// This class cannot be inherited.
///
///
///
[AttributeUsage(AttributeTargets.Parameter)]
public sealed class FormDataAttribute : Attribute, IRequestDataAttribute
{
///
public Task GetRequestDataAsync(WebApiController controller, string parameterName)
=> controller.HttpContext.GetRequestFormDataAsync();
}
}