I've been doing something wrong that used to work and now fails. possible bug, most likely a programming mistake on my part, but perhaps the docs should make a note so as to prevent this in the future.
If you pass null as the second argument to request, and an object as the first argument, it will fail. For example:
var cuser = process.env.COUCHDB_USER ;
var cpass = process.env.COUCHDB_PASS ;
var chost = process.env.COUCHDB_HOST ;
var cport = process.env.COUCHDB_PORT || 5984;
options.headers.authorization = "Basic " + new Buffer(cuser + ":" + cpass).toString('base64');
var r = request(options,null);
That will fail.
I am piping the output t from couchdb, so I don't really need the callback function. I've been passing null, but I noticed today that with firstname.lastname@example.org that breaks with the error:
throw e; // process.nextTick error, or 'error' event on first tick
TypeError: Cannot set property 'uri' of null
at request (/home/james/node_modules/request/main.js:793:17)
at Object.<anonymous> (/home/james/requestfail.js:15:9)
Passing nothing as the second argument works fine:
var r = request(options);
Is this still an issue?
This is so old I'm closing, if it is actually still an issue just let me know and I'll re-open.