title: Is using [FromBody] on my back end to recognize a WebAPI parameter good practice?
body: <p>I've got a front end WebAPI written with angular and TypeScript that looks like this.</p>
  
  <pre><code>    removeSubset(id: number): ng.IPromise&lt;any&gt; {
          return this.$http.post(this.api + '/DeleteStudySubset', id)
              .then(this.returnData);
      }
  
      returnData = (response: any) =&gt; {
          return response.data;
      };
  </code></pre>
  
  <p>And the back end version it calls out to is written like this</p>
  
  <pre><code>    [HttpPost]
      [ResponseType(typeof(IHttpActionResult))]
      public async Task&lt;IHttpActionResult&gt; DeleteStudySubset(int id)
      {
          await _subsetRepo.DeleteStudySubset(id);
          return Ok();
      }
  </code></pre>
  
  <p>At first I was getting a URI 404 Error and I couldn't figure it out for the life of me. Then I stumbled across the parameter binding [FromBody] attribute and using it fixed the 404 issue.</p>
  
  <p>So the back end API  was rewritten to include the attribute and looked like so</p>
  
  <pre><code>    [HttpPost]
      [ResponseType(typeof(IHttpActionResult))]
      public async Task&lt;IHttpActionResult&gt; DeleteStudySubset([FromBody] int id)
      {
          await _subsetRepo.DeleteStudySubset(id);
          return Ok();
      }
  </code></pre>
  
  <p>From what I think I vaguely understand [FromBody] is telling my back end to not reference the url that is pointing to the back end but search the body of what's being sent to it? Is that right? I don't think I'm explaining my hazy understanding well.</p>
  
  <p>My more, to-the-point question is more or less outlined in the title and is: Is using the [FromBody] attribute on my back end to fix my 404 good practice, or is it more of a hack solution? </p>
  
  <p>It feels like it was too easy of a solution and I'm worried if overall it is a non-elegant solution, and I just slapped a quick-fix on top of a more serious issue. Such as not configuring my front or back end API correctly to work in sync with one another.</p>