Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Adding JsonInputFormatter for reading json encoded data from the request body #87

Closed
wants to merge 1 commit into from

Conversation

pranavkm
Copy link
Contributor

No description provided.

private const string ContentTypeHeader = "Content-Type";
private const string CharSetToken = "charset=";

public static ContentTypeHeaderValue GetContentType(this HttpRequest httpRequest)
Copy link
Contributor Author

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.

@rynowak
Copy link
Member

rynowak commented Mar 14, 2014

:shipit: after changing that resource name 😎

/// </summary>
public JsonSerializerSettings SerializerSettings
{
get { return _jsonSerializerSettings; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MaxDepth = 32

@pranavkm
Copy link
Contributor Author

PR Updated.

@pranavkm
Copy link
Contributor Author

Would you be able to sign off on this today?

@rynowak
Copy link
Member

rynowak commented Mar 19, 2014

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?
Copy link
Contributor Author

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

Copy link
Contributor

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.

@pranavkm pranavkm closed this Mar 21, 2014
@pranavkm pranavkm deleted the Json branch March 21, 2014 03:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants