title: Using optional complex type action parameter for a POST Web API
body: <p>I am trying to write an API with the following prototype:</p>
  
  <pre><code>[HttpPost]
  public ApplicationStatus appLogIn(string id, UserCredentials userCredentials = null)
  </code></pre>
  
  <p>But when I make a request to this API, with or without <code>userCredentials</code>, I get the following error with response code as <code>500</code></p>
  
  <pre><code>{
    "Message": "An error has occurred.",
    "ExceptionMessage": "Optional parameter 'userCredentials' is not supported by 'FormatterParameterBinding'.",
    "ExceptionType": "System.InvalidOperationException",
    "StackTrace": null
  }
  </code></pre>
  
  <p>If I do not make the userCredentials as optional, everything works fine. The userCredential definition is as follows:</p>
  
  <pre><code>public class UserCredentials
  {
      public string password { get; set; }
      public string username { get; set; }
  }
  </code></pre>