javascript - i need to send a post request from the worklight adapter -
i using ibm worklight need send post request server worklight adapter calling in way supposed xml content response server getting html , failing kindly me same post request sending through rest client xml output coming perfectly
my code in adapter is
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); }
is there mistake in sending post request ..please help
thanks in advance
yeah upgrading worklight 5.0.5 5.0.6 solved problem idan adar lot
Comments
Post a Comment