Commit 027e855aec2a051bd1b6014727e0292423ef02c6

Authored by Fernando Brito
1 parent 0145c7e1
Exists in master and in 1 other branch devel

Adiciona código de debug em requests

Showing 1 changed file with 11 additions and 1 deletions   Show diff stats
helpers/requests.js
@@ -13,7 +13,17 @@ function postRequest(path, data) { @@ -13,7 +13,17 @@ function postRequest(path, data) {
13 }; 13 };
14 14
15 var requesting = http.request(options, function(res) { 15 var requesting = http.request(options, function(res) {
16 - res.setEncoding('utf8'); 16 + /* Debugging */
  17 + /*
  18 + console.log('Callback response status: ' + res.statusCode);
  19 + console.log('Callback response headers: ' + JSON.stringify(res.headers));
  20 +
  21 + res.setEncoding('utf8');
  22 +
  23 + res.on('data', function (chunk) {
  24 + console.log('Callback response body: ' + chunk);
  25 + });
  26 + */
17 }); 27 });
18 28
19 requesting.on('error', function (e) { 29 requesting.on('error', function (e) {