- wymsee/cordova-HTTP plugin is better than this plugin.
###Installation
$> cordova plugin add plugin.http.request
var httpReq = new plugin.HttpRequest();
httpReq.get("http://your.domain/get/", function(status, data) {
alert(data);
});
httpReq.getJSON("http://your.domain/get/JSON/", function(status, data) {
alert(JSON.stringify(data));
});
httpReq.post("http://your.domain/post/", {
name: $("input[name='name']").val(),
email: $("input[name='email']").val()
},function(err, data) {
alert(data);
});
httpReq.post("http://your.domain/post/JSON/", {
name: $("input[name='name']").val(),
email: $("input[name='email']").val()
},function(err, data) {
alert(JSON.stringify(data));
});