我在qooxdoo玩REST服务,我看到有一个 实验班http://manual.qooxdoo.org/1.6/pages/communication/rest.html
允许轻松创建通信,但我找不到任何示例 如下:
感谢您的建议。
答案 0 :(得分:0)
1.6的文档也没有解释,但2.0的文档提供了一些线索......
声明具体内容
var customers = new qx.io.rest.Resource({
create: {
method: "POST",
url: "/customers"
});
发布/发布有效负载:
costumers.create({ "surname": "none",
"name": "none",
"email": "someone@example.com",
"description": "nothing",
"address": "Southpole"
});
在url中传递参数:
声明具体内容
var customers = new qx.io.rest.Resource({
get: {
method: "GET",
url: "/customers?{args}"
});
并且在致电时
var arguments = "arg1=10&arg2=10";
customers.get({arg:arguments});
// this will geneterate the following http://example.com/customers?agr1=10&arg2=10