var tt = '<root><name>student</name><age>12</age></root>'
var myAjax = new Ajax.Request(
'http://localhost:8080/server/QueryData',
{method: 'post', parameters: tt, onComplete: showResponse}
);
服务器上为什么接收的不是tt那样的数据,而是“%3Croot%3E%3Cname%3Estudent%3C%2Fname%3E%3Cage%3E12%3C%2Fage%3E%3C%2Froot%3E”?
用prototype的Ajax方法,如果发送的是xml,应该用post方法,而且不要用parameters参数,而是用postBody代替。
看prototype的源码,如果用parameters,它做了以下处理:
params = Hash.toQueryString(params);
在这里它被encodeURIComponent了,所以到后台的'<'和'>'就是那种字符了。
var tt = '<root><name>student</name><age>12</age></root>'
var myAjax = new Ajax.Request(
'http://localhost:8080/server/QueryData',
{method: 'post', postBody: tt, onComplete: showResponse}
);
分享到:
相关推荐
prototype-160-api.rar prototype-160-api.rar
Prototype-1.6.0-zh.chm 中文手册。好不容易找到的最新的prototype手册。
AS-23-Shcherbakov-Prototype-Pollution-Leads-to-RCE
prototype-151-api
ember-disable-prototype-extensions-源码.rar
IOS设计模式浅析之原型模式(Prototype)--copy - iOS知识库1
Prototype Carousel Class-图片走马灯
Internet-of-Things-with-Python-Interact-with-the-world-and-rapidly-prototype-IoT-applications-using-Python.pdf
Learning-Robotics-Using-Python-Design-simulate-program-and-prototype-an-interactive-autonomous-mobile-robot-from-scratch-with-the-help-of-Python-ROS-and-Open-CV-.pdf
PROTOTYPE 1.5.1 RC1 API文档 <br>API DOCUMENTATION <br>Welcome to the API documentation for Prototype. The left column contains the main sections. When you activate a section, its detailed ...
python库。 资源全名:eth_prototype-0.2.0-py2.py3-none-any.whl
1.1. Prototype是什么? 1.2. 关联文章 1.3. 通用性方法 1.3.1. 使用 $()方法 1.3.2. 使用$F()方法 1.3.3. 使用$A()方法 1.3.4. 使用$H()方法 1.3.5. 使用$R()方法 1.3.6. 使用Try.these()方法 1.4. Ajax 对象 1.4.1....
NULL 博文链接:https://dodomail.iteye.com/blog/251704
CVP2018用于分类的卷积原型网络实现代码以及测试的mnist数据集,详细情况见博客:https://blog.csdn.net/zmdsjtu/category_7035858.html
它将创建用于资产和配置安装本地模块npm install prototype - psd - parser -- save - dev全局模块npm install prototype - psd - parser - g用法本地模块var psdParser = require ( 'prototype-psd-parser' ) ;...
prototype进度条的实现例子,采用经典prototype技术进行开发的经典案例
prototype-tongwen-gjsprototype-tongwen-gjs
Python库是一组预先...例如,Matplotlib和Seaborn库在数据可视化领域内非常受欢迎,它们提供了广泛的工具和技术,可以创建高度定制化的图表和图形,帮助数据科学家和分析师在数据探索和结果展示中更有效地传达信息。
Python库是一组预先...例如,Matplotlib和Seaborn库在数据可视化领域内非常受欢迎,它们提供了广泛的工具和技术,可以创建高度定制化的图表和图形,帮助数据科学家和分析师在数据探索和结果展示中更有效地传达信息。