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 8347125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:15:42+00:00 2026-06-09T07:15:42+00:00

When creating a default ASP.NET Web Api project, default ValuesController has post method like

  • 0

When creating a default ASP.NET Web Api project, default ValuesController has post method like this:

// POST api/values
public void Post(string value)
{
}

I was trying to test this POST method from Filder with HTTP request:

POST /api/values

User-Agent: Fiddler
Host: localhost
Content-Type: application/x-www-form-urlencoded

value=abc

That was surprised to me, the input parameter value is null, not abc. It surely worked in beta version, but in RC version, Am I doing something wrong OR it is not working like this anymore?

Of course we have another way to work around by creating strong type object below:

public Class TestDto
{
    public string Value { get; set; }
}

public void Post(TestDto testDto)
{  
}

Or use Json.

But I would like to have more understanding on this.

  • 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-09T07:15:46+00:00Added an answer on June 9, 2026 at 7:15 am

    (1) By default, simple types are taken from the URI. To read a simple type from the request body, add the [FromBody] attribute to the parameter. (Known issue with the project template. In the RTM release, the project template will include this in ValuesController.)

    (2) For formurl-encoded, send a simple type as “=abc” not “value=abc”; see http://www.asp.net/web-api/overview/working-with-http/sending-html-form-data,-part-1#sending_simple_types.

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

Sidebar

Related Questions

I have a simple ASP.NET Web User Control. It looks like this: <%@ Control
When creating a new ASP.NET AJAX Web Application in Visual Studio 2005, the default
I've got an ASP.NET application that I installed by creating a web setup. I
I got a problem. When i'm creating the new project in ASP.NET using VS
i've stuck with problem. I have an ASP.NET project with dynamically creating controls. Even
I'm creating a multi-tenant Asp.Net MVC 3 Web app, and using EF4.1 code first
I'm creating a web application in asp.net mvc2 and I'm having a little problem
When you create a new ASP.NET project with membership it creates the default connection
Trying to optimize one web project. It uses asp.net (webforms), bunch of jquery plugins
This is my first ASP.NET project and I'm stuck right away. I'm setting up

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.