-
-
Save abrkn/8972942 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
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: JSON.stringify({ | |
'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) { | |
var id = console.log(JSON.parse(httpResponse.text)); | |
console.log('Callback id: ' + id); | |
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