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

  • Home
  • SEARCH
  • 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 8782073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:28:21+00:00 2026-06-13T20:28:21+00:00

Assuming a ApiController with an action having multiple arguments: [HttpPost] public void AddAddress( Person

  • 0

Assuming a ApiController with an action having multiple arguments:

[HttpPost]
public void AddAddress( Person person, Address address, int simple )

Or something like that.
Now I try to send a post request with content type application/json and json like this:

{
  person: {...}, address: {..}, simple: 1
}

just assume it’s valid json 😉

or in a json array like this:
[person, address, simple]

But WebApi won’t recognize this and tell me it can’t find the action, as it doesn’t support multiple parameters in a json request.

I’m doing this from a C# client using HttpClient and we’d like to do post requests using json. I wanted to use the WebApi.Client package, which provides several useful extensions to the HttpClient, but we have a portable library project(which webapi client doesn’t support).

How would I go about supporting this feature?

I tried to use an custom ActionFilter, which never get’s to run as it can’t find the action beforehand. I tried MediaTypeFormatter which doesn’t know the context and the arguments, and also I tried ModelBinder, which also seems only on a per argument basis and doesn’t always get executed.

Thanks!

  • 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-13T20:28:22+00:00Added an answer on June 13, 2026 at 8:28 pm

    The built-in parameter binding strategy in ASP.NET Web API with formatters only supports a single complex argument mapped to the request body. In your case, you are trying to map at least two complex arguments. The simplest solution without extending this infrastructure would be to create a new model class containing those arguments as properties

    public class AddressModel
    {
      public Person Person { get; set; }
      public Address Address { get; set; }
      public int Simple { get; set; }
    }
    

    And use that model in your controller action

    public void AddAddress( AddressModel model );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Assuming I have a collection in MongoDB with 5000 records, each containing something similar
Assuming I have an Entity Framework 4.2 class like this: class Company { public
Assuming one table CAR with two columns CAR_ID (int) and VERSION (int) . I
Assuming that I have an variable like: int n = 23; it is possible
Assuming that we have a T myarray[100] with T = int, unsigned int, long
Assuming that I'm talking about an ASP.NET MVC 3 application, the scenario is something
Assuming I'm trying to automate the installation of something on windows and I want
assuming below table; column name | type id | int date | varchar When
Assuming that I have a basic enum like: public enum Color { Red, Green,
Assuming defintion: case class IntegerWrapper(i : Int) and being in a situation that potentially

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.