Skip to content

Instantly share code, notes, and snippets.

@heumn
Last active August 29, 2015 13:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save heumn/8955387 to your computer and use it in GitHub Desktop.
Save heumn/8955387 to your computer and use it in GitHub Desktop.
Parse.Cloud.job("testImageCompression", function(request, response) {
console.log("Posting HTTP request");
Parse.Cloud.httpRequest({
method: 'POST',
url: 'https://api.kraken.io/v1/url',
headers: {
'Content-Type': 'application/json'
},
body: {
'auth': {
'api_key': 'MY KEY EDITED OUT',
'api_secret': 'MY SECRET EDITED OUT'
},
'url': 'https://www.google.no/images/srpr/logo11w.png',
'wait': true
},
success: function(httpResponse) {
console.log(httpResponse.text);
response.success("Succsess");
},
error: function(httpResponse) {
console.error('Request failed with response status ' + httpResponse.status);
response.success("Error");
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment