In Node.js HTTP
module’s documentation: http://nodejs.org/api/http.html#http_http_request_options_callback
You can either call http.get('http://eternagame.wikia.com/wiki/EteRNA_Dictionary', callback)
, the URL is then parsed with url.parse()
; or call http.get(options, callback)
, where options
is
{ host: 'eternagame.wikia.com', port: 8080, path: '/wiki/EteRNA_Dictionary' }
Update
As stated in the comment by @EnchanterIO, the port
field is also a separate option; and the protocol http://
shouldn’t be included in the host
field. Other answers also recommends the use of https
module if SSL is required.