BlueGit

blue-star danique-bot

Files

danique-bot / node_modules / phantomjs-prebuilt / lib / phantom / examples / post.js

post.js

Import template
timfa Tim · pushed by timfa · 4 years ago
c788ad20 History
post.js 394 B Download Raw
1// Example using HTTP POST operation
2
3"use strict";
4var page = require('webpage').create(),
5 server = 'http://posttestserver.com/post.php?dump',
6 data = 'universe=expanding&answer=42';
7
8page.open(server, 'post', data, function (status) {
9 if (status !== 'success') {
10 console.log('Unable to post!');
11 } else {
12 console.log(page.content);
13 }
14 phantom.exit();
15});