c# - 如何从 asp.net 核心指定请求编码、响应编码?
问题描述
如何从 asp.net 核心指定请求编码、响应编码?
在 Web.config 中指定了 asp.net 项目。
<globalization requestEncoding="euc-kr" responseEncoding="euc-kr" />
和回应
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/html; charset=euc-kr
Server: Microsoft-IIS/10.0
X-AspNetMvc-Version: 5.2
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Wed, 14 Jul 2021 01:50:12 GMT
Content-Length: 229
从 asp.net core 项目返回的响应
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8
Content-Encoding: gzip
Vary: Accept-Encoding
Server: Microsoft-IIS/10.0
X-Powered-By: ASP.NET
Date: Wed, 14 Jul 2021 01:53:46 GMT
如何更改全球化编码类型?
解决方案
推荐阅读
- google-drive-api - 如何从 Google Collab 上的驱动器访问 zip 文件?
- google-apps-script - 在 google sheet apt 脚本中将数据写入变量时遇到问题
- jackson - Jackson @JsonAlias 没有反序列化 xml
- ios - iOS 是否有某种类型的 GPS 缓存?
- vue-component - 如何停止 v-autocomplete 组件中图标的旋转?
- python - 如何在 ubuntu 中使用 python 自动连接到 SSH?
- google-apps-script - 将网站特定数据导入 Google 表格
- javascript - 如何根据使用 Vue.js 检查的单选按钮有条件地呈现元素
- c# - 如何从 Firebase 存储下载图像?
- reactjs - 我的文件生成 pdf 仅显示 10% 的屏幕