title: Fiddler testing API Post passing a [Frombody] class
body: <p>I have this very simple C# APIController named "TestController" with an API method as:</p>
  
  <pre><code>[HttpPost]
  public string HelloWorld([FromBody] Testing t)
  {
      return t.Name + " " + t.LastName;
  }
  </code></pre>
  
  <p>Contact is just a class that look like this:</p>
  
  <pre><code>public class Testing
  {
      [Required]
      public string Name;
      [Required]
      public string LastName;
  }
  </code></pre>
  
  <p>My APIRouter looks like this:</p>
  
  <pre><code>config.Routes.MapHttpRoute(
       name: "TestApi",
       routeTemplate: "api/{controller}/{action}/{id}",
       defaults: new { id = RouteParameter.Optional }
  );
  </code></pre>
  
  <p><strong>QUESTION 1</strong>:<br>
  How can I test that from a C# Client?</p>
  
  <p>For #2 I tried the following code:</p>
  
  <pre><code>private async Task TestAPI()
  {
      var pairs = new List&lt;KeyValuePair&lt;string, string&gt;&gt; 
      {
         new KeyValuePair&lt;string, string&gt;("Name", "Happy"),
         new KeyValuePair&lt;string, string&gt;("LastName", "Developer")
      };
  
      var content = new FormUrlEncodedContent(pairs);
  
          var client = new HttpClient();                        
          client.DefaultRequestHeaders.Accept.Add(
               new MediaTypeWithQualityHeaderValue("application/json"));
  
          var result = await client.PostAsync( 
               new Uri("http://localhost:3471/api/test/helloworld", 
                      UriKind.Absolute), content);
  
          lblTestAPI.Text = result.ToString();
      }
  </code></pre>
  
  <p><strong>QUESTION 2</strong>:<br>
  How can I test this from Fiddler?<br>
  Can't seem to find how to pass a Class via the UI.</p>