lib/Request.js
function toHeaderString(params, realm) {
    var arr = [];
    var i;

    for (i in params) {
        if (typeof params[i] !== 'object' && params[i] !== '' && params[i] !== undefined) {
            arr.push(encode(i) + '="' + encode(params[i]) + '"');
        }
    }

    arr.sort();
    if (realm) {
        arr.unshift('realm="' + encode(realm) + '"');
    }

    return arr.join(', ');
}
function toHeaderString(params, realm) {
    var arr = [];
    var i;

    for (i in params) {
        if (typeof params[i] !== 'object' && params[i] !== '' && params[i] !== undefined) {
            arr.push(encode(i) + '="' + encode(params[i]) + '"');
        }
    }

    arr.sort();
    if (realm) {
        arr.unshift('realm="' + encode(realm) + '"');
    }

    return arr.join(', ');
}
Get a string of the parameters for the OAuth Authorization header

@param params {object} A key value paired object of data
example: {'q':'foobar'}
for GET this will append a query string