title: Why I can't get a post request in the controller?
body: <p>I want to get the body of a post in a controller.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>[HttpPost]
  public string GetMsg([FromBody]GetMsgModel GSM)
  {
      return "";
  }
  </code></pre>
  
  <p>And posted class</p>
  
  <pre><code>public class GetMsgModel { 
      public string ToUserName { get; set; }
      public string FromUserName { get; set; }
      public string CreateTime { get; set; }
      public string MsgType { get; set; }
      public string Content { get; set; }
      public string MsgId { get; set; }
  }
  </code></pre>
  
  <p>I added a breakpoint to the <code>GetMsg</code> and send a post via postman with this XML body:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;xml&gt;
    &lt;ToUserName&gt;123&lt;/ToUserName&gt;
    &lt;FromUserName&gt;456&lt;/FromUserName&gt;
    &lt;CreateTime&gt;1348831860&lt;/CreateTime&gt;
    &lt;MsgType&gt;789&lt;/MsgType&gt;
    &lt;Content&gt;000&lt;/Content&gt;
    &lt;MsgId&gt;1234567890123456&lt;/MsgId&gt;
  &lt;/xml&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/sgsN6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sgsN6.png" alt="enter image description here"></a></p>
  
  <p>Well, the breakpoint does not run at all.</p>
  
  <p>What's wrong with this? There is another <code>HttpGet</code> method in the same controller and it works well. It seems it is not the problem of the controller yet.</p>