Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Replacement for HttpResponse.ContentEncoding ASP.NET 5

Does anyone know if there is a replacement in ASP.NET 5 for HttpResponse.ContentEncoding? https://msdn.microsoft.com/en-us/library/system.web.httpresponse.contentencoding(v=vs.110).aspx

like image 391
koelkastfilosoof Avatar asked Jul 09 '15 14:07

koelkastfilosoof


1 Answers

Example:

var mediaType = new MediaTypeHeaderValue("application/json");
mediaType.Encoding = Encoding.UTF8;
httpContext.Response.ContentType = mediaType.ToString();
like image 157
Kiran Avatar answered Nov 06 '22 00:11

Kiran