You need to send a json request using the Curl utility to the service for recognizing emotions
Service https://api.projectoxford.ai/emotion/v1.0/recognize , which recognizes the emotions on the face of a person in the photo.
The description shows examples for different PL and for Curl:
curl -v -X POST "https://api.projectoxford.ai/emotion/v1.0/recognize" -H "Content-Type: application/json" -H "Ocp-Apim-Subscription-Key: {subscription key}" --data-ascii "{body}" {body} must be an image url.
key - a unique key for access that can be obtained during registration. I have such a key, I will provide 1 key, then I will generate it again when the question closes.
9cd1728ed38c49278236aae4b56d9ade
The key is working, you can use.
An example of my request:
curl -v -X POST "https://api.projectoxford.ai/emotion/v1.0/recognize" -H "Content-Type: application/json" -H "Ocp-Apim-Subscription-Key: 0022db3b0ff34391b6e60dea801086bc" --data-ascii "{"url": "http://images.webpark.ru/uploads54/110818/Portraits_04.jpg"}" My answer:
* Hostname was NOT found in DNS cache * Trying 40.68.24.134... * Connected to api.projectoxford.ai (40.68.24.134) port 443 (#0) * successfully set certificate verify locations: * CAfile: none CApath: /etc/ssl/certs * SSLv3, TLS handshake, Client hello (1): * SSLv3, TLS handshake, Server hello (2): * SSLv3, TLS handshake, CERT (11): * SSLv3, TLS handshake, Server key exchange (12): * SSLv3, TLS handshake, Server finished (14): * SSLv3, TLS handshake, Client key exchange (16): * SSLv3, TLS change cipher, Client hello (1): * SSLv3, TLS handshake, Finished (20): * SSLv3, TLS change cipher, Client hello (1): * SSLv3, TLS handshake, Finished (20): * SSL connection using ECDHE-RSA-AES256-SHA384 * Server certificate: * subject: CN=*.projectoxford.ai * start date: 2015-04-14 04:15:32 GMT * expire date: 2017-04-13 04:15:32 GMT * subjectAltName: api.projectoxford.ai matched * issuer: C=US; ST=Washington; L=Redmond; O=Microsoft Corporation; OU=Microsoft IT; CN=Microsoft IT SSL SHA2 * SSL certificate verify ok. > POST /emotion/v1.0/recognize HTTP/1.1 > User-Agent: curl/7.35.0 > Host: api.projectoxford.ai > Accept: */* > Content-Type: application/json > Ocp-Apim-Subscription-Key: 0022db3b0ff34391b6e60dea801086bc > Content-Length: 65 > * upload completely sent off: 65 out of 65 bytes < HTTP/1.1 400 Bad Request < Cache-Control: no-cache < Pragma: no-cache < Content-Length: 60 < Content-Type: application/json; charset=utf-8 < Expires: -1 < X-Powered-By: ASP.NET < apim-request-id: b7f40e3a-6205-4a71-9cd8-9f0e9f9f5d0e < Date: Mon, 01 Aug 2016 16:31:47 GMT < * Connection #0 to host api.projectoxford.ai left intact {"error":{"code":"BadBody","message":"JSON parsing error."}} As you can see, nothing comes out, because The answer should be in the format:
[ { "faceRectangle": { "left": 68, "top": 97, "width": 64, "height": 97 }, "scores": { "anger": 0.00300731952, "contempt": 5.14648448E-08, "disgust": 9.180124E-06, "fear": 0.0001912825, "happiness": 0.9875571, "neutral": 0.0009861537, "sadness": 1.889955E-05, "surprise": 0.008229999 } } ]