private static CompoundModelBinder <T> getCompoundModelBinder(IWebResponse response) { // Extract property values from headers and the content CompoundModelBinder <T> binder = new CompoundModelBinder <T>(); binder.AddBinder(new NameValueCollectionModelBinder <T>(response.Response.Headers)); StringComparison comparison = StringComparison.InvariantCultureIgnoreCase; if (String.Compare(response.Response.ContentType, JsonExtensions.ContentType, comparison) == 0) { binder.AddBinder(new JsonModelBinder <T>(response.FromString <string>())); } else if (String.Compare(response.Response.ContentType, FormExtensions.ContentType, comparison) == 0) { binder.AddBinder(new NameValueCollectionModelBinder <T>(response.FromForm())); } else if (response.Response.ContentType.StartsWith(MultiPartExtensions.ContentTypePrefix, comparison)) { binder.AddBinder(new MultiPartModelBinder <T>(response.FromMultiPart())); } return(binder); }