我正在使用IBM Worklight我需要从工作灯适配器发送一个发布请求到服务器我以这种方式调用我应该得到xml内容作为响应服务器,但我得到的HTML,它是失败的好心帮我 同一职位的要求正通过REST客户端的XML输出发送完美来我需要从工作灯适配器发送发布请求
我的适配器代码是
function showAttributes()
{
var truevar ="True";
var pubvar ="public";
var gridvar = "GridView";
var gvar ="Grid View 1 ";
var request = '<rdf:RDF xmlns:dcterms="http://purl.org/dc/terms/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rs="http://www.w3.org/2001/sw/DataAccess/tests/result-set#" xmlns:rrmNav="http://com.ibm.rdm/navigation#" xmlns:rrmViewdata="http://com.rdm/viewdata#" xmlns:rt="https://crizz.net/qw/views" xmlns:rm="http://www.crizz.com/xmlns/rdm/rdf/" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:rql="http://www.crizz.com/xmlns/rdm/rql/" xmlns:owl="http://www.w3.org/2002/07/owl#">' +
'<rtm:View rdf:about="">' +
'<rtm:rowquery rdf:parseType="Resource"> ' +
' <rdf:Seq>' +
'<rdf:li rdf:resource="https://jazz.net/rtm/folders/_maPswFcdEeCVbIiWC7_0yA"/>'+
'</rdf:Seq>' +
' </rql:e2>' +
'<rql:op>' + invar + '</rql:op>' +
'</rdf:_1>' +
'</rql:where>' +
'</rtm:rowquery>' +
'<rtm:displayBaseProperties rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">' + truevar + '</rtm:displayBaseProperties>' +
'<rrmNav:scope>' + pubvar + '</rrmNav:scope>'+
'<rtm:ofType>' + gridvar + '</rtm:ofType>' +
'<dcterms:description> </dcterms:description>' +
'<dcterms:title>' + gvar +'</dcterms:title>' +
'</rtm:View>' +
'</rdf:RDF>';
var input = {
method : 'post',
returnedContentType : 'application/xml',
path : lpath,
headers : {
'RP-Request-Type' : 'private',
},
body : {
contentType: 'text/plain; charset=utf-8',
content: request.toString()
},
parameters : {
'oslc.query' : 'execute=true&fullObject=false&size=20&count=true&page=1&reuse=false&'
}
};
return WL.Server.invokeHttp(input);
}
是否有发送任何错误POST请求..请帮助
在此先感谢
谁能帮助我解决这个问题 – anilgontla