The Constraint Entry 'httpMethod' on the Route Must Have a String Value
问题 I have an asp.net Web API project, and in my WebApiConfig file, I have the following route defined: config.Routes.MapHttpRoute( name: "Web API Get", routeTemplate: "api/{controller}", defaults: new { action = "Get" }, constraints: new { httpMethod = new HttpMethodConstraint("GET") } ); For integration testing purposes, I want to make a request to an HttpSelfHostServer to verify that we are receiving the proper data back from the api call. I am making the HttpRequestMessage as follows: var