In my code, when a certain exception happens, im returning
Response.AddHeader("X-Status", "çãõáéí");
Response.Charset = "utf-8";
Response.HeaderEncoding = Encoding.UTF8;
return new HttpStatusCodeResult(403, "You lack permission X, Y and Z");
and using Postman I was surprised to see 3 things:
- the body of the response. it should be empty.. the response should contain only headers, but the body is actually full of html/css...
- the
Content-Typeheader was only "text/html" and not "text/html charset=utf-8" - there was nothing indicating that "Response.HeaderEncoding" was set... whether it was set to utf8 or utf32 or big-indian...
So, how can I "make" the body empty? meaning that I wish the content of the response to be clear... Extra points if you are able to teach me to encode X-Status so the browser displays especial chars correctly and not like a upside down question mark...
