What's the correct HttpStatusCode to return for a required parameter that's missing?
asp.net-web-api, http-status-codes
Solution
400, or if the name parameter is part of the URI then you could return 404.
Problem
I'm building a Web API method to check if a name is unique of that type and need to make sure the name parameter is given. What's the correct status code to return? ``` public HttpResponseMessage GetIsNameUnique(string name) { if (string.IsNullOrWhiteSpace(layoutName)) { throw new HttpResponseException(new HttpResponseMessage { StatusCode = HttpStatusCode.{What Goes Here?}, Content = new StringContent("The name is required.") }); } // more code here to check.... } ```