Changeset 413 in tmcsimulator for trunk/webapps/cptms/js/harLayer.js


Ignore:
Timestamp:
05/21/2019 07:53:16 AM (7 years ago)
Author:
jdalbey
Message:

cmsLayer.js,harLayer.js modified to use POST requests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/webapps/cptms/js/harLayer.js

    r400 r413  
    117117        outString = "{\"data\":" + jsonstring + "}"; 
    118118 
    119         var xhttp = new XMLHttpRequest(); 
    120         xhttp.open("GET", "../cgi-bin/saveHARmessage.py?msg=" + outString, true); 
    121         xhttp.send(); 
    122         // Using POST might be a better idea ... haven't tried this yet 
    123         //      var xhr = new XMLHttpRequest(); 
    124         //      xhr.open("POST", "/cgi-bin/saveMessage.py?", true); 
    125         //      xhr.setRequestHeader('Content-Type', 'application/json; charset=UTF-8'); 
     119        //var xhttp = new XMLHttpRequest(); 
     120        //xhttp.open("GET", "../cgi-bin/saveHARmessage.py?msg=" + outString, true); 
     121        //xhttp.send(); 
     122        // Using POST to send the data  
     123        var xhr = new XMLHttpRequest(); 
     124        xhr.open("POST", "../cgi-bin/saveHARmessage.py", true); 
     125        xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 
    126126        // send the collected data as JSON 
    127         //      xhr.send(JSON.stringify(messageList)); 
     127        xhr.send("msg="+outString); 
    128128    } 
    129129 
Note: See TracChangeset for help on using the changeset viewer.