mirror of https://github.com/lukechilds/docs.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
394 B
15 lines
394 B
// Example using HTTP POST operation
|
|
|
|
"use strict";
|
|
var page = require('webpage').create(),
|
|
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();
|
|
});
|
|
|