Hi,
I have been trying to use XMLHttpRequest to send POST data from a widget.
Here is my code:
And then the call back functionCode:var pdata = "POSTDATATOSEND"; reqp = new XMLHttpRequest(); reqp.onreadystatechange = postCallback; reqp.open("POST", url, true); reqV.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); reqp.setRequestHeader("Content-length", pdata.length); reqp.setRequestHeader("Connection", "close"); reqp.send(pdata);
I keep getting null in the alert box that outputs reqp.responseTextCode:function postCallback() { //alert (reqV.readyState); if (reqV.readyState == 4) { if (reqV.status == 200) { /* * little overhead here, one could use also string for version info */ alert (reqp.responseText); } else { alert( "connection error: " + reqp.status ); } } }
Is POST method not allowed supported in Widgets? Going through the examples I only see GET used.
regards,
Magnus

Reply With Quote



