Closed floatdrop closed 9 years ago
When response is invalid (not 20x) there is no way to get response data (nor headers):
var ask = require('asker'); ask({ host : 'google.com' }, function(error, response) { console.error(error); console.log(response.data); }); // => [AskerError: Unexpected status code {CODE:302} in // the response for request in 63~84 ms http://google.com:80/] /* /Users/floatdrop/frontdays-got/ask.js:5 console.log(response.data); ^ TypeError: Cannot read property 'data' of undefined */
It behaves as designed. Read the manual, pls.
Sorry, from your presentation slides I thought that statusFilter is only affects 50x codes by default.
statusFilter
When response is invalid (not 20x) there is no way to get response data (nor headers):