[jboss-as7-dev] dmr.js
    Heiko Braun 
    hbraun at redhat.com
       
    Tue Apr  9 02:11:59 EDT 2013
    
    
  
Here's a code sample:
<script>
// access EC2 demo instance
http = new XMLHttpRequest();
http.withCredentials = true;
http.open("POST", "http://as7-preview.dyndns.org:9990/management", true);
// async response handler
http.onreadystatechange =function()
{
    if (http.readyState==4 && http.status==200)
    {
        // decode response
        response = dmr.ModelNode.fromBase64(http.responseText);
        alert(response.get("result").asString());
    }
}
// content type headers for DMR API
http.setRequestHeader("Content-type","application/dmr-encoded");
http.setRequestHeader("Accept","application/dmr-encoded");
// create an operation
op = new dmr.ModelNode();
op.get("operation").set("read-attribute");
op.get("address").setEmptyList();
op.get("name").set("release-version");
// send as base64 encoded
http.send(op.toBase64String());
</script>
On Apr 8, 2013, at 1:20 PM, Heiko Braun <hbraun at redhat.com> wrote:
> 
> 
> If you want to use the DMR API form plain JS and need all the typing build in, the dmr.js might be your friend:
> 
> https://github.com/hal/dmr.js
> 
> 
> Regards, Heiko
> _______________________________________________
> jboss-as7-dev mailing list
> jboss-as7-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-as7-dev/attachments/20130409/fdc7e488/attachment.html 
    
    
More information about the jboss-as7-dev
mailing list