Last active
November 3, 2017 11:27
-
-
Save vickonrails/8d57430ef8a28be516df603b998ed2f3 to your computer and use it in GitHub Desktop.
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
$.ajax({ | |
url : "https://api.unsplash.com/search/photos?query=home", | |
type: "GET", | |
async : true, | |
contentType: "application/x-www-urlencoded", | |
dataType : "json", | |
beforeSend: function (xhr) { | |
xhr.setRequestHeader("Authorization", "Client-ID your-client-id"); | |
}, | |
error : function(xhr,status,error){ | |
console.log(xhr); | |
}, | |
success : function(xhr,status,error){ | |
console.log(xhr); | |
}, | |
cache : true | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment