我们有接受POST请求的WebApi服务。 POST请求中的信息具有此Unicode字符 - (http://www.fileformat.info/info/unicode/char/a1/index.htm)使用卷曲 - 字符编码问题向WebApi发送POST请求
当我们使用Fiddler测试服务时,信息在服务器上正确接收。不过,虽然使用curl做的相同信息的POST,性格得到改变这一个从特价块 - http://www.fileformat.info/info/unicode/char/fffd/index.htm
为什么这知不知道正在发生的事情,以及我们如何能得到卷曲请求POST正确编码的东西,将不胜感激
编辑: 卷曲请求
curl --trace-ascii debug.txt -d "=VALT ¡ OFFER = '111501383'" http://localhost:25980/api/uni
阿比控制器代码
// POST api/<controller>
public string Post([FromBody]string value)
{
// code to process the value
}
提琴手请求(使用作曲家选项卡)
POST http://localhost:25980/api/uni HTTP/1.1
Accept: text/html, application/xhtml+xml, */*
Accept-Language: en-IN,en;q=0.5
User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)
Content-Type: application/x-www-form-urlencoded; charset=US-ASCII
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
Content-Length: 47
Host: localhost:25980
"=VALT ¡ OFFER = '111501383'"
您是否可以添加发送请求的卷发代码。另外,'ApiContoller'代码会很有帮助。 –
更新的问题与代码 – jbagavathi
这是卷曲在Windows上吗?命令行上的非ASCII字符可能会非常棘手。这是一个unicode(/ U)控制台吗? – bzlm