File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ .idea /*
Original file line number Diff line number Diff line change 1+ var https = require ( 'https' ) ;
2+ var querystring = require ( 'querystring' ) ;
3+
4+ var url = "https://www.whoisxmlapi.com/whoisserver/WhoisService?" ;
5+
6+ var parameters = {
7+ domainName : 'google.com' ,
8+ username : 'YOUR_USERNAME' ,
9+ password : 'YOUR_PASSWORD' ,
10+ outputFormat : 'json'
11+ } ;
12+
13+ url = url + querystring . stringify ( parameters ) ;
14+
15+ https . get ( url , function ( res ) {
16+ const statusCode = res . statusCode ;
17+
18+ if ( statusCode !== 200 ) {
19+ console . log ( 'Request failed: '
20+ + statusCode
21+ ) ;
22+ }
23+
24+ var rawData = '' ;
25+
26+ res . on ( 'data' , function ( chunk ) {
27+ rawData += chunk ;
28+ } ) ;
29+ res . on ( 'end' , function ( ) {
30+ try {
31+ var parsedData = JSON . stringify ( rawData ) ;
32+ console . log ( parsedData ) ;
33+ } catch ( e ) {
34+ console . log ( e . message ) ;
35+ }
36+ } )
37+ } ) . on ( 'error' , function ( e ) {
38+ console . log ( "Error: " + e . message ) ;
39+ } ) ;
You can’t perform that action at this time.
0 commit comments