-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Adding JsonInputFormatter for reading json encoded data from the request body #87
Conversation
private const string ContentTypeHeader = "Content-Type"; | ||
private const string CharSetToken = "charset="; | ||
|
||
public static ContentTypeHeaderValue GetContentType(this HttpRequest httpRequest) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to made more robust once we decide where it'll live.
|
/// </summary> | ||
public JsonSerializerSettings SerializerSettings | ||
{ | ||
get { return _jsonSerializerSettings; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MaxDepth = 32
PR Updated. |
Would you be able to sign off on this today? |
Looks 🚢-able from where I'm sitting, you probably should get @yishaigalatzer to signoff as well since most comments were his. |
var contentType = request.GetContentType(); | ||
if (contentType == null) | ||
{ | ||
// TODO: http exception? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is tracked via WebFX-159
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
G2g
-----Original Message-----
From: Pranav K
Sent: 3/20/2014 4:52 PM
To: aspnet/WebFx
Cc: Yishai Galatzer
Subject: Re: [WebFx] Adding JsonInputFormatter for reading json encoded datafrom the request body (#87)
In src/Microsoft.AspNet.Mvc.ModelBinding/Formatters/TempInputFormatterProvider.cs:
- public class TempInputFormatterProvider : IInputFormatterProvider
- {
private readonly IInputFormatter[] _formatters;
public TempInputFormatterProvider(IEnumerable<IInputFormatter> formatters)
{
_formatters = formatters.ToArray();
}
public IInputFormatter GetInputFormatter(InputFormatterProviderContext context)
{
var request = context.HttpContext.Request;
var contentType = request.GetContentType();
if (contentType == null)
{
// TODO: http exception?
This is tracked via WebFX-159
—
Reply to this email directly or view it on GitHub.
No description provided.