Open Phantom JS
Open an url with Node Phantom JS:
open(url, method, data)(callback);
- url: the url to open. If it's relative like in
/hi
, it will openhttp://localhost:3000/hi
. Otherwise you can pass the full path such as inhttp://localhost:8080/hi
- method [default:
GET
]: how to open the request, it can be 'GET' or 'POST'. Note: 'get', 'Get' and others will be converted with.toUpperCase()
- data [default:
""
]: a string or object of the data to pass. If it's a string, it should be encoded such asweb=open%20phantom
. If it's an object it will be encoded, such as in{ web: 'open phantom' }