You should write a wrapper for `request` that does exactly what this bit does but returns a promise. I'd also expose a version which parses any JSON output