/// <summary>
/// Decodes the request body.
/// </summary>
/// <param name="request">The request.</param>
/// <exception cref="InternalServerException">Failed to decode form data.</exception>
protected virtual void DecodeBody(HttpRequest request)
{
try
{
if (request.Body.Length > 0)
request.DecodeBody(_formDecodersProvider);
}
catch (InvalidOperationException err)
{
throw new InternalServerException("Failed to decode form data.", err);
}
catch (InvalidDataException err)
{
throw new InternalServerException("Form contains invalid format.", err);
}
}