Extera API CORS Tester

by jamesdh

HTML

<div id="output"></div>

JavaScript

var username = "demo";
var password = "demo";

$.ajax("http://localhost:8080/app/api/context/list", {
    //data: data, // for POST'ing data
    dataType: 'json',
    type: 'get',
    headers: {Authorization: "Basic " + window.btoa(username + ":" + password)},
    success: function(data, status) {
        $('#output').append(status + ": " + data);   
        console.log(data);
    },
    error: function(xhr, status, error) {
        $('#output').append(status + ": " + error);
        console.log(xhr);
    }
});