基本上是这样,但是我在 POST 数据中遇到了国家符号的问题。他们被破坏到服务中。
我有非常基本的标记:
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<form action="/hello" method="POST">
<input name="Name" id="Name"/>
<input type="submit" value="Send"/>
</form>
</body>
</html>
浏览器发送以下内容:
标题:
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding:gzip,deflate,sdch
Accept-Language:uk,ru;q=0.8,en;q=0.6 Cache-Control:max-age=0
Connection:keep-alive Content-Length:41
Content-Type:application/x-www-form-urlencoded
Cookie:ss-pid=s2uF57+2p07xnT9nUcpw; X-UAId=
Host:localhost:2012
Origin:http://localhost:2012
Referer:http://localhost:2012/Great
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36
表格数据:
Name=%D0%BF%D1%80%D0%B8%D0%B2%D1%96%D1%82
在服务中,我收到以下内容:
РїСЂРёРІС–С
而 this.Request.OriginalRequest.EncodingName 是“西里尔文(Windows)”。我认为这里应该是 UTF-8。预期结果是
привіт
PS。App.config(我正在使用 Self-Host)默认来自http://www.ienablemuch.com/2012/12/self-hosting-servicestack-serving.html