Skip to content

Instantly share code, notes, and snippets.

@sjcotto
Created June 26, 2014 01:07
Show Gist options
  • Save sjcotto/bc0edabd9c250a09ce5c to your computer and use it in GitHub Desktop.
Save sjcotto/bc0edabd9c250a09ce5c to your computer and use it in GitHub Desktop.
Helpers Rest Comunication for Kona
//APIS para KONA.JS
//Comunicacion con RESTServices
var test = function(){
var request = {
url : "http://host.com/api",
method: HTTP.GET,
data: {
field1: "value",
field2: "value"
}
headers : {
header1 : "value"
}
}
//con el request armado lo enviamos
var response = kona.net.rest.send(request);
if (response.status == 200) {
//hacer algo con el response
var data = response.data;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment