Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8304201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:46:59+00:00 2026-06-08T17:46:59+00:00

Is it possible for the Web API to map values from a message body

  • 0

Is it possible for the Web API to map values from a message body to the argument list? For example, if I had this:

public HttpResponseMessage Post(int id, string value1, string value2) {}

instead of this:

public HttpResponseMessage Post(MyCustomClass message) {}

I was posting JSON via fiddler and could only get the latter to work. Although I much prefer the latter, I was just curious if it were possible to get the first example to work. I could get it to work using querystring params, but I couldn’t get it to work posting form values or json. Just curious.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T17:47:02+00:00Added an answer on June 8, 2026 at 5:47 pm

    No it’s not possible. Mike Stall has a great post explaining this in details – http://blogs.msdn.com/b/jmstall/archive/2012/04/16/how-webapi-does-parameter-binding.aspx

    In short, in MVC you only had model binders, and the entire request body was buffered and fed into the binder.

    In Web API you have both model binders and formatters.

    Rule of thumb is that Web API uses model binders to read querystring parameters and formatters to read the body. And the request body is not buffered – it’s a read-only, one directional, async stream. Therefore you can only read one thing from the body – whether it is a simple type (i.e. string, int) or complex type, doesn’t matter – it can only be one thing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to target DelegatingHandlers (message handlers) in WCF Web Api at specific
Is it possible for a web page using Javascript to get data from another
Is it possible to make requests to a Web API with ASP classic? For
Is it possible to save the google map image API as an image to
Does skype have an api from which it would be possible to create a
Is it possible to make a private API to communicate from a native application
I have a web page with a google map (api v3) that has dozens
Possible Duplicate: Web Service vs WCF Service Duplicate: Web Service vs WCF Service What
Is it possible to edit web.config file of my cloud app deployed on Windows
is it possible to consume web service (written in c#, ... I don't have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.