1
1
mirror of https://github.com/ariya/phantomjs.git synced 2024-08-15 15:50:34 +03:00
phantomjs/examples/post.js
2020-06-12 07:47:11 -07:00

16 lines
395 B
JavaScript

// Example using HTTP POST operation
"use strict";
var page = require('webpage').create(),
server = 'http://ptsv2.com/t/phantomjs-toilet/post',
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();
});