Friday, February 13, 2015

HTTP Request with Javascript

<script type="text/javascript">

var oReq = new ActiveXObject("MSXML2.XMLHTTP.3.0");

function handler()
    if (oReq.readyState == 4 /* complete */) {
        if (oReq.status == 200) {
            document.getElementById("myDiv").innerText = oReq.responseText;

function SendRequest()
    var vURL = "http://IdolApp:12345/data/data.xml";

    if (oReq != null) {"GET", vURL, true);
        oReq.onreadystatechange = handler;
    else {
        window.console.log("AJAX (XMLHTTP) not supported.");

<input type="button" id="btnSubmit" value="Go" onclick="SendRequest()"/>
<div id="myDiv" >:o)</div>

Initialize the oReq with following to make it IE and Chrome compatible:
var oReq;

if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
 oReq=new XMLHttpRequest();
{// code for IE6, IE5
 oReq=new ActiveXObject("Microsoft.XMLHTTP");

Microsoft Flow - HTTP REST Call

In this blog post, I will cover what is a workflow and how we can create a workflow using Microsoft Flow that can make HTTP REST calls to br...