Skip to content

Instantly share code, notes, and snippets.

@vickonrails
Last active November 3, 2017 11:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vickonrails/8d57430ef8a28be516df603b998ed2f3 to your computer and use it in GitHub Desktop.
Save vickonrails/8d57430ef8a28be516df603b998ed2f3 to your computer and use it in GitHub Desktop.
$.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