+ -
当前位置:首页 → 问答吧 → 求助HTTP post方式发送xml文档

求助HTTP post方式发送xml文档

时间:2011-08-23

来源:互联网

我采用http协议post方式上报XML文件到一个url,到了服务器端解析的时候,发现发送的
<?xml version="1.0" encoding="GBK"?>变成了<?xml version=%221%2EO%22+encoding%3D%22GBK%22%3F%3E&
请问是怎么回事啊?
代码如下
XMLDoc := TXMLDocument.create(Nil);
  XMLDoc.Active := true;
  XMLDoc.Version := '1.0';
  XMLDoc.Encoding := 'GBK';
  url := 'http://192.168.0.8:8080/proxy/plproxy?swglm=320200004031696';
  IdHTTP := TIdHTTP.create(Nil);
  IdHTTP.Request.AcceptEncoding := 'gbk';
  IdHTTp.Request.AcceptCharSet := 'GBK';
  IdHTTP.Request.ContentType := 'application/x-www-form-urlencoded';
  IdHTTP.Request.ContentLength := Length(Memo1.Text);
  strsends := tstringlist.create;
  strsends.AddStrings(XMLDoc.xml);
  strResult := IdHTTP.Post(url, strsends);

作者: sunrainxue   发布时间: 2011-08-23

编码问题?

作者: omagic   发布时间: 2011-08-23

但问题是我通过其他方式发送GBK,没有问题啊

作者: sunrainxue   发布时间: 2011-08-23

还是我这边的mysql的编码没有选择正确

作者: sunrainxue   发布时间: 2011-08-23

热门下载

更多