code: function httpRequest(path, req, options)
  {
      return new Promise(function(resolve, reject) {
          req = extend({}, defaults, req, options);
          req.url += path;
  
          request(req, function(error, response, body) {
              if (error || !(/^2/.test('' + response.statusCode)) || /action=".?login.lua"/.test(body)) {
                  if (/action=".?login.lua"/.test(body)) {
                      // fake failed login if redirected to login page without HTTP 403
                      response.statusCode = 403;
                  }
                  reject({
                      error: error,
                      response: response,
                      options: req
                  });
              }
              else {
                  resolve(body.trim());
              }
          });
      });
  }
docs: Execute HTTP request that honors failed/invalid login