lib/driver.js
function (hostname, port, prefix, url, method, body, auth) {
      var options = {
        hostname: hostname,
        port: port,
        path: prefix + url,
        method: method,
        headers: {
          'Content-Type': 'application/json;charset=utf-8',
          'Content-Length': Buffer.byteLength(body, 'utf8')
        }
      };

      // check if auth information is available
      if (auth) {
        options.auth = auth;
      }

      return options;
    }
function (hostname, port, prefix, url, method, body, auth) {
      var options = {
        hostname: hostname,
        port: port,
        path: prefix + url,
        method: method,
        headers: {
          'Content-Type': 'application/json;charset=utf-8',
          'Content-Length': Buffer.byteLength(body, 'utf8')
        }
      };

      // check if auth information is available
      if (auth) {
        options.auth = auth;
      }

      return options;
    }
function ( hostname , port , prefix , url , method , body , auth ) { var options = { hostname : hostname , port : port , path : prefix + url , method : method , headers : { 'Content-Type' : 'application/json;charset=utf-8' , 'Content-Length' : Buffer . byteLength ( body , 'utf8' ) } } ; // check if auth information is available if ( auth ) { options . auth = auth ; } return options ; }
Generates the request options for a webdriver client request

@method generateRequestOptions
@param {string} hostname Hostname of the webdriver server
@param {integer} port Port of the webdriver server
@param {string} prefix Url address prefix of the webdriver endpoint
@param {string} url Url of the webdriver method
@param {string} method Request method e.g. (GET, POST, DELETE, PUT)
@param {string} body The message body of the request
@return {object} options Request options
Generates the request options for a webdriver client request