Skip to content
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

Allows posting content from file #66

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

xmilliard
Copy link

Hello,

we are using your library with great success. We need to be able to upload file using oauth authentication.

Here is a patch for doing that.

It essentially add a new function :

exports.OAuth.prototype.postFromFile= function(url, oauth_token, oauth_token_secret, fileName, post_content_type, callback) {
return this._putOrPost("POST", url, oauth_token, oauth_token_secret, fileName, post_content_type, callback, true);
}

and add one more parameter (fromFile) to _putOrPost and _performSecureRequest functions to interpret body_content parameter as content or file name.

This implementation has only be done for oauth1.

Please feel free to ask for any modifications helping integration in your repo.

Thanks for your lib.

Xavier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant