javascript - Calling the Facebook API from CasperJS? -


i'm trying call facebook api using casperjs, using url so:

https://graph.facebook.com/<app_id>/accounts/test-users?installed=false&name=joe&locale=en_us&method=post&access_token=<access_token> 

it works fine when put in browser (i fine json result), about:blank page when try access in casperjs script. i've tried various methods:

casper.open(url); casper.open(url, { method: 'post' }); casper.open(url, { method: 'get' }); // though should post... casper.open(url, { method: 'put' }); // still trying stuff casper.open(baseurl, { method: 'post', data: { ... } }); 

when current url, about:blank, , when content, it's empty page:

<html><head></head><body></body></html> 

from getpagecontent() docs:

var casper = require('casper').create(); var url = '<your url here>';  casper.start().then(function() {     this.open(url, {         method: 'get',         headers: {             'accept': 'application/json'         }     }); });  casper.run(function() {     require('utils').dump(json.parse(this.getpagecontent()));     this.exit(); }); 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -