How to make a POST request using Advanced Rest Client

I am learning the basics of ASP.Net MVC 5. And I want to make a POST request to one of my actions with the controller present in SecurityControllerusing Advanced rest Client. But I can’t do it. Please guide me.

Below is my attempt:

[HttpPost]
public ActionResult Hello(SampleMV viewModel)
{
    return Content("Hello");
}

public class SampleMV
{
    public int one { get; set; }
    public int two { get; set; }
    public int? three { get; set; }
}

Now what are the changes I need to make in my extended leisure client?

Step 1. Set the request drop-down list to POST

Step 2. In the unprocessed payload section, I added below:

one = 2, two = 3, three = 4  seperated by comma.

I am not sure if this is the right way.

Step 3. I need to specify some type of content or any other configuration. I am currently getting an error like Resource not found.

Here is a screenshot:

enter image description here EDIT: Another try

+4
2

, JSON { "one":2, "two":3, "three":4 }

+3

404 , . , . , SecurityController.Hello, , /security/hello . RouteConfig.cs.

, ApiController, , . , Hello PostHello.

, JSON, . "" /x -www-form-urlencoded, .. one=1&two=2&three=3

+4

Source: https://habr.com/ru/post/1676392/


All Articles