title: WebApi - Passing an Array of Values
body: <p>I need to build an API using ASP.NET Web API (version 4.5.2). To get started, I'm just trying to create a basic endpoint that adds some numbers. In an attempt to do this, I've created:</p>
  
  <pre><code>[RoutePrefix("api/test")]
  public class MyController : ApiController
  {
    [HttpGet]
    public IEnumerable&lt;int&gt; Calulate(decimal[] op1, decimal[] op2)
    {
      var results = new List&lt;Calculation&gt;();
      for (var i=0; i&lt;op1.Length; i++) 
      {
        var calculation = new Calculation();
        calculation.Operand1 = op1[i];
        calculation.Operand2 = op2[i];
        calculation.Calculate();
  
        results.Add(calculation);
      }
      return results;
    }
  
    public class Calculation
    {
      public int Operand1 { get; set; }
      public int Operand2 { get; set; }
      public int Result { get; set; }
  
      public void Calculate()
      {
        this.Result = this.Operand1 + this.Operand2;
      }
    }
  }
  </code></pre>
  
  <p>I am now trying to hit this endpoint via the Postman Chrome app. When I run it via Postman, I'm getting an error. Here is what I'm doing:</p>
  
  <p>In Postman, I've put "<a href="http://localhost:50668/api/test/calculate" rel="noreferrer">http://localhost:50668/api/test/calculate</a>" in the URL field next to the "GET" drop down. I then click "Send". I'm receiving the following error:</p>
  
  <pre><code>{
    "Message": "An error has occurred.",
    "ExceptionMessage": "Can't bind multiple parameters ('op1' and 'op2') to the request's content.",
    "ExceptionType": "System.InvalidOperationException",
    "StackTrace": "..."
  } 
  </code></pre>
  
  <p>I think (I don't know) the cause is because I'm not passing the values to the API from Postman correctly. However, I'm not sure how to do that. How do I pass an array of values to an API?</p>