In WebAPI, say I return a string wrapped in an HTTP response:
return Request.CreateResponse(HttpStatusCode.BadRequest, \"Line1 \\r\\n Line2\");
What you are after is a custom MediaTypeFormatter. It sounds like you wish to implement your own custom one to replace and existing or you're creating a new custom one all together depending what what Accept header you're expecting. Good news is you can swap out existing ones or come up with a new MediaType of you like. A couple places that will help get you started can be found here:
http://byterot.blogspot.com/2012/04/aspnet-web-api-series-part-5.html
http://www.asp.net/web-api/overview/formats-and-model-binding/media-formatters
Yes, I've actually done this in small part as I've swapped out some of the default formatter e.g. JSON with a faster one i.e. ServiceStack and it works great.