xxxxxxxxxx
$("#getBtn").click(function(){
$.get('https://api.the api you want to get')
.done(function(data){
console.log(data);
})
.fail(function(){
console.log("ERROR!");
})
});
/////////////////////////////////////
$("#postBtn").click(function(){
var data = {name: "Charlie", city: "Florence"};
$.post("www.the website where you want to post", data)
.done(function(data){
console.log("HI!");
})
.fail(function(){
console.log("ERROR!");
})
});