-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
expose internal request object #106
Comments
After using the simple implementation described above for a few weeks in a heavily used app it seems to be working fine and very stable. I created pull request #111 for the change. |
Fixed in 1.0.0. We have exposed the request object with every API call. It is the return value for every API call. Example in 1.0.0: var google = require('googleapis');
var drive = google.drive('v2');
var req = drive.files.insert({ /* ... */, callback);
// access upload / download progress here
console.log(req.uri.href); // example that prints out api endpoint being requested |
Thanks, it's working great. I've migrated to 1.0 and adapted to the changes, my app is working perfectly right off your release code without any "hacks" anymore. |
Happy to hear! :) |
Need to keep track and/or expose the internal request object so application can customize behavior - for example track progress of upload/download.
the ideal option is to use eventEmitter like the original Request module is doing and raise an event with the reququest object once it's submitted..
another option is to return a request object wrapper in the execute method which is currently not returning anything.
and yet another (simple) option is to keep the last request created in a variable under the DefaultTransporter object.
I am currently using this option but I'm not making a pull request as I don't think it's elegant/generic enough.
The text was updated successfully, but these errors were encountered: