aacerox / node-rest-client

REST API client from node.js
MIT License
377 stars 132 forks source link

Issue with defined methods #135

Closed micsen closed 7 years ago

micsen commented 7 years ago

`var url="http://www.w3schools.com/html/action_page.php"; var args={'lastname': 'mouse'} client.registerMethod("api", url ,"GET");

client.methods.api(args, function (data, response) { console.log(response); if(Buffer.isBuffer(data)){ data = data.toString('utf8'); } console.log(data); }); ` Tells me there was no get data sent with the request

micsen commented 7 years ago

Actually after attempting a simple get i also end up with the same result.

3rand commented 7 years ago

I also confirm the same behavior. I also tried several definitions of: mimetypes: { json: ['application/json', 'application/json;charset=utf-8', 'application/json; charset=utf-8', 'application/json;charset=UTF-8', 'application/json; charset=UTF-8'], }

aacerox commented 7 years ago

Hi you're creating the wrong args object. correct way is (as you can see in docs):

var args={
    parameters:{'lastname': 'mouse'}
};

Please read the documentation carefully before posting an issue.

Thanks.