Cleaned up code
This commit is contained in:
@@ -120,14 +120,14 @@ async function formatXML(xml) {
|
||||
}
|
||||
|
||||
function showRequestBody(element){
|
||||
requestBody = "";
|
||||
document.getElementById('code-highlight-content').innerText = "Loading...";
|
||||
var historyRequestBody = historyJson[element.id].requestBody;
|
||||
const popupContent = document.getElementById('code-highlight-content')
|
||||
|
||||
document.getElementById('code-highlight-content').innerText = "Loading...";
|
||||
switch(historyJson[element.id].headers["content-type"]){
|
||||
case "application/json":{
|
||||
formatJSON(historyRequestBody).then(function(result) {
|
||||
document.getElementById('code-highlight-content').innerText = result.data;
|
||||
console.log(result.data);
|
||||
popupContent.innerText = result.data;
|
||||
highlightSyntax('code-highlight-content');
|
||||
});
|
||||
break;
|
||||
@@ -135,11 +135,11 @@ function showRequestBody(element){
|
||||
case "application/xml":{
|
||||
formatXML(historyRequestBody).then(function(result) {
|
||||
if (result.status == "OK") {
|
||||
document.getElementById('code-highlight-content').innerText = result.result;
|
||||
popupContent.innerText = result.result;
|
||||
highlightSyntax('code-highlight-content');
|
||||
}
|
||||
else {
|
||||
document.getElementById('code-highlight-content').innerText = historyRequestBody;
|
||||
popupContent.innerText = historyRequestBody;
|
||||
}
|
||||
|
||||
});
|
||||
@@ -147,7 +147,7 @@ function showRequestBody(element){
|
||||
break;
|
||||
}
|
||||
default:{
|
||||
document.getElementById('code-highlight-content').innerText = historyRequestBody;
|
||||
popupContent.innerText = historyRequestBody;
|
||||
highlightSyntax('code-highlight-content');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user