You can use this:
return Content(HttpStatusCode.BadRequest, "Any object");
More Related Contents:
- Why should I use IHttpActionResult instead of HttpResponseMessage?
- Returning http status code from Web Api controller
- JWT authentication for ASP.NET Web API
- .NET HttpClient. How to POST string value?
- Adding Http Headers to HttpClient
- Make sure that the controller has a parameterless public constructor error
- FromBody string parameter is giving null
- JSON.NET Parser *seems* to be double serializing my objects
- Deserialising JSON to derived types in Asp.Net Web API
- How to set up a Web API controller for multipart/form-data
- Custom method names in ASP.NET Web API
- Asp Net Web API 2.1 get client IP address
- Difference between MVC 5 Project and Web Api Project
- Enable CORS in Web API 2
- Writing MemoryStream to Response Object
- web-api POST body object always null
- How can Xml Documentation for Web Api include documentation from beyond the main project?
- How to put conditional Required Attribute into class property to work with WEB API?
- Compress HTTP GET Response
- How to to return an image with Web API Get method
- TempData null in asp.net core
- Using ADAL C# as Confidential User /Daemon Server /Server-to-Server – 401 Unauthorized
- Get the current user, within an ApiController action, without passing the userID as a parameter
- How to use DI container when OwinStartup
- Running self-hosted OWIN Web API under non-admin account
- AngularJS Web Api AntiForgeryToken CSRF
- Web API: Configure JSON serializer settings on action or controller level
- WebAPI Request Streaming support
- Changing the parameter name Web Api model binding
- How to use caching in ASP.NET Web API?