Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
    <title>JSSample</title>
</head>
<body>
<script type="text/javascript">
    $(function() {
    var params = {
        // Request parameters
        "returnFaceId": "true",
        "returnFaceLandmarks": "false",
        "returnFaceAttributes": "age",
    };
    $.ajax({
        url: "https://api.projectoxford.ai/face/v1.0/detect?" + $.param(params),
        beforeSend: function(xhrObj){
            // Request headers
            xhrObj.setRequestHeader("Content-Type","application/json");
            xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key","e2c75ad5d44846d590ac7c2dcc2f210e");
        },
        type: "POST",
        // Request body
        data: '{ "url": "http://newsrescue.com/wp-content/uploads/2015/04/happy-person.jpg"}'
    })
    .done(function(data) {
        console.log(data);
        alert("success");
    })
    .fail(function() {
        alert("error");
    });
});
</script>
</body>
</html>
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers