Created
June 26, 2014 01:07
-
-
Save sjcotto/bc0edabd9c250a09ce5c to your computer and use it in GitHub Desktop.
Helpers Rest Comunication for Kona
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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