Created
June 5, 2016 00:45
-
-
Save sayar/754497e131281778bee457f4f9db7b6e to your computer and use it in GitHub Desktop.
Emotion API Node.js Sample Code
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
var request = require('request'); | |
request({ | |
method: 'POST', | |
url: 'https://api.projectoxford.ai/emotion/v1.0/recognize', | |
headers: { | |
'Content-Type': 'application/json', | |
'Ocp-Apim-Subscription-Key': 'PUT KEY HERE' | |
}, | |
body: JSON.stringify({ | |
url: 'https://pbs.twimg.com/media/CkIcZcuUYAE5WLD.jpg:large' | |
}) | |
}, function (error, response, body) { | |
if (!error && response.statusCode == 200) { | |
var object = JSON.parse(body); | |
console.dir(object, {depth: null, colors: true}) | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment