Skip to content

Instantly share code, notes, and snippets.

@ariya
Created May 28, 2011 09:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ariya/996733 to your computer and use it in GitHub Desktop.
Save ariya/996733 to your computer and use it in GitHub Desktop.
Example using HTTP POST operation
var page = new WebPage(),
server = 'http://posttestserver.com/post.php?dump',
data = 'universe=expanding&answer=42';
page.open(server, 'post', data, function (status) {
if (status !== 'success') {
console.log('Unable to post!');
} else {
console.log(page.content);
}
phantom.exit();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment