def request_to_dict(request, spider=None):
 cb = request.callback
 if callable(cb):
  cb = _find_method(spider, cb)
 eb = request.errback
 if callable(eb):
  eb = _find_method(spider, eb)
 d = {'url': request.url.decode('ascii'), 'callback': cb, 'errback': eb, 'method': request.method, 'headers': dict(request.headers), 'body': request.body, 'cookies': request.cookies, 'meta': request.meta, '_encoding': request._encoding, 'priority': request.priority, 'dont_filter': request.dont_filter}
 return d

def request_to_dict ( request , spider = None ) : cb = request . callback if callable ( cb ) : cb = _find_method ( spider , cb ) eb = request . errback if callable ( eb ) : eb = _find_method ( spider , eb ) d = { 'url' : request . url . decode ( 'ascii' ) , 'callback' : cb , 'errback' : eb , 'method' : request . method , 'headers' : dict ( request . headers ) , 'body' : request . body , 'cookies' : request . cookies , 'meta' : request . meta , '_encoding' : request . _encoding , 'priority' : request . priority , 'dont_filter' : request . dont_filter } return d
convert request object to a dict .