Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #34 from nortron/master

Display HTTP response code between call URI and headers.
  • Loading branch information...
commit 76f900b83bb4fcb491c48809eb252b5f0246ef19 2 parents 7ac39c7 + b91dd71
@mansilladev mansilladev authored
Showing with 12 additions and 2 deletions.
  1. +2 −1  app.js
  2. +10 −1 public/javascripts/docs.js
View
3  app.js
@@ -668,7 +668,8 @@ app.post('/processReq', oauth, processRequest, function(req, res) {
var result = {
headers: req.resultHeaders,
response: req.result,
- call: req.call
+ call: req.call,
+ code: req.res.statusCode
};
res.send(result);
View
11 public/javascripts/docs.js
@@ -207,6 +207,10 @@
resultContainer.append($(document.createElement('h4')).text('Call'));
resultContainer.append($(document.createElement('pre')).addClass('call'));
+ // Code
+ resultContainer.append($(document.createElement('h4')).text('Response Code'));
+ resultContainer.append($(document.createElement('pre')).addClass('code prettyprint'));
+
// Header
resultContainer.append($(document.createElement('h4')).text('Response Headers'));
resultContainer.append($(document.createElement('pre')).addClass('headers prettyprint'));
@@ -256,6 +260,11 @@
.text(response.call);
}
+ if (response.code) {
+ $('pre.code', resultContainer)
+ .text(response.code);
+ }
+
if (response.headers) {
$('pre.headers', resultContainer)
.text(formatJSON(response.headers));
@@ -288,4 +297,4 @@
})
})
-})();
+})();
Please sign in to comment.
Something went wrong with that request. Please try again.