Problem with REST api call

61 views
Skip to first unread message

Ashutosh Das

unread,
Nov 22, 2013, 5:35:07 AM11/22/13
to nod...@googlegroups.com
I m using https://github.com/danwrong/restler  for pastebin  REST client.  
Here is my code :

var sys = require('util'),
    rest = require('restler');

var key = "my key";
var paste = " test from nodejs";

var apipas = "paste";

var name = "hirenTest" ;

var hiren = new Object();

  hiren.api_dev_key =key,
  hiren.api_option = apipas,
  hiren.api_paste_code = paste,

 // method : "POST" ,
  query : hiren
}).on('complete', function(data) {
  console.log(data);
});

Everytime I run this code it shows  "Bad API request, invalid api_option" .

greelgorke

unread,
Nov 22, 2013, 8:16:16 AM11/22/13
to nod...@googlegroups.com
you are posting, your hiren object should go as data not as query. just an asumption.

greelgorke

unread,
Nov 22, 2013, 8:18:13 AM11/22/13
to nod...@googlegroups.com
se also the examples in the readme on github. the post example uses data


Am Freitag, 22. November 2013 11:35:07 UTC+1 schrieb Ashutosh Das:

Ashutosh Das

unread,
Nov 22, 2013, 8:21:06 AM11/22/13
to nod...@googlegroups.com
So how can i pass parameter  ?


--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
 
---
You received this message because you are subscribed to a topic in the Google Groups "nodejs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nodejs/sqRGIThNud4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nodejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ashutosh Das

unread,
Nov 22, 2013, 8:23:16 AM11/22/13
to nod...@googlegroups.com
thanks its working now  :)
Reply all
Reply to author
Forward
0 new messages