替换 HttpResponse.ContentEncoding ASP.NET 5

Replacement for HttpResponse.ContentEncoding ASP.NET 5

有谁知道 ASP.NET 5 中是否有 HttpResponse.ContentEncoding 的替代品? https://msdn.microsoft.com/en-us/library/system.web.httpresponse.contentencoding(v=vs.110).aspx

Microsoft.Framework.WebEncoders.EncoderExtensions

有 HtmlEncode、JavaScriptStringEncode 和 UrlEncode 扩展

基数 Class 是 Microsoft.Framework.WebEncoders

示例:

var mediaType = new MediaTypeHeaderValue("application/json");
mediaType.Encoding = Encoding.UTF8;
httpContext.Response.ContentType = mediaType.ToString();