title: Getting 415 error when trying to pass in multiple arguments to a get request in React with axios
body: <p>This might be easy (or hard) to answer, I'm new to react but haven't found a solution to my problem.</p>
  
  <p>I made an api that looks like this:</p>
  
  <pre><code>[HttpGet]
  [Route("GetDateRange")]
  public IActionResult GetDateRange(DateRangeModel model)
  {
   ...
  }
  </code></pre>
  
  <p>So it takes in a DateRangeModel object. This object simply looks like this:</p>
  
  <pre><code>public class DateRangeModel
  {
      public int PlayerId { get; set; }
      public DateTime StartDate { get; set; }
      public DateTime EndDate { get; set; }
  }
  </code></pre>
  
  <p>Now on the frontend, in react, I always seem to get a 415 (unsupported media error) no matter how I try to pass in the values. Here is my latest attempt with some hardcoded values:</p>
  
  <pre><code>var body = {
      playerId: 2, 
      startDate: '2020-01-01',
      endDate: '2020-03-03'
  };
  
  var myJson = JSON.stringify(body);
  
  const result = await axios.get('http://localhost:64390/api/players/getdaterange/', myJson);
  console.log(result);
  </code></pre>
  
  <p>When I enter this in the body in Postman it works perfectly and I get the 200 OK message along with the correct json response:</p>
  
  <pre><code>{
      "playerId": 2,
      "startDate": "2020-01-01",
      "endDate": "2020-03-03"
  }
  </code></pre>
  
  <p>Thank you for any help.</p>