code: function(args) {
  
  	args = typeof args === 'string' ? { base: args } : args;
  
  	this.log = args.logger;
  
  	if (!this.log) {
  		var logLevel = args.logLevel || process.env.LOG_LEVEL || 'info';
  		this.log = log4js.getLogger('armrest');
  		this.log.setLevel(logLevel.toUpperCase());
  	}
  
  	if (args.base) {
  
  		// tack on a scheme if it wasn't supplied
  		var base = args.base;
  		if (!base.match(/^https?:\/\//)) {
  			base = 'http://' + base;
  		}
  
  		var urlComponents = url.parse(base);
  		this.protocol = urlComponents.protocol || 'http';
  		this.auth = urlComponents.auth;
  		this.hostname = urlComponents.hostname;
  		this.port = urlComponents.port;
  		this.basePath = urlComponents.pathname.length > 1 ? urlComponents.pathname : '';
  
  	} else {
  
  		this.protocol = args.protocol || 'http';
  		this.auth = args.auth;
  		if (args.host) {
  			this.hostname = args.host.split(':')[0];
  			this.port = args.host.split(':')[1];
  		} else {
  			this.hostname = args.hostname;
  			this.port = args.port;
  		}
  		this.basePath = '';
  
  	}
  
  	this.auth = parseAuth(this.auth);
  	this.serializer = args.serializer || defaultSerializer;
  	this.timeout = args.timeout;
  	this.headers = args.headers || {};
  	this.request = request.defaults({});
  
  }
docs: /*
  Client constructor