Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


'Options' atribute as callback's aditional parameter #334

gvuyk opened this Issue · 1 comment

2 participants

Gerard Vuyk Mikeal Rogers
Gerard Vuyk

Is there a way to get an attribute from the "Options" object to the callback function?
Something like this:

data = {'a': 'some data'}
request({url: '', userObj: data}, callback);

function callback(error,response,body,userObj)
       console.log(userObj);     // {  'a':  'some data' }

In my case, I'm making lots of requests and some of these requests needs to be made based on the parsed body of the previous one and an object created before the last request was made

Does it make sense?

Mikeal Rogers

options get turned in to properties or function calls (depending on the option) during construction.

var r = request({url: '', userObj: data})
r.uri // url.parse() version of url
Mikeal Rogers mikeal closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.