1.0.3 • Published 10 years ago

oauthclient v1.0.3

Weekly downloads
9
License
MIT
Repository
github
Last release
10 years ago

image

Client OAuth 1.0a Request Authorization for Node

Built with Grunt Build Status Code Climate Dependency Status devDependency Status npm version npm downloads NPM

Example

API

  • create(options) - creates instance, create unique instance(supports Singletone) public - public key secret - secret key
  • fetch(request object, callback) request object - must have 1. URL - URL to request - mandatory 2. Method - Method to use, GET/POST - mandatory 3. body - data when using POST method - optonal 4. json - true/false - optional true when passing objet * false when passing string

    	* ```callback``` - The callback argument gets 2 arguments:
    		1. An error when applicable (usually from http.ClientRequest object)
    		2. An http.IncomingMessage object

Example

	var oauthClient = require("oauthclient").create({
            public: "asdfg2345tghj89uk9klas34d5f6g7uhj9kl",
            secret: "s3d4f56g7h8jk09j8h7g6fcvb7n8m90"
	};
	var requestObj = {
            "method": "GET",
            "url": "https:///www.domain.taht.spports.oauth1.0"
        };
        oauthClientInstance.fetch(requestObj, function (err, data) {
        	/// do somthing with err or data
        });