Class XmlBodyParser<TModel>
Parser for an XML request body
Implements
IBodyParser<TModel>
Namespace: Seltzr.Parsers
Assembly: Seltzr.dll
Syntax
C#
public class XmlBodyParser<TModel> : IBodyParser<TModel> where TModel : class
Type Parameters
TModel
The type to parse to
Methods
Gets whether or not the request body can be parsed by this IBodyParser<TModel>
C#
public virtual Task<bool> CanParse(HttpContext context)
Parameters
context
HttpContext
The context for the HTTP request
Returns
true if the request body can be parsed by this IBodyParser<TModel>, false otherwise
Parses an XML request body
C#
public virtual Task<ParseResult<TModel>[]> Parse(byte[] body, ParserOptions options, HttpContext context)
Parameters
body
Byte[]
The data of the request body
options
ParserOptions
Options for the parser
context
HttpContext
The context for the HTTP request
Returns
Task<ParseResult<TModel>[]>
The parsed models