Node.js request directly to URL with options (http or https) -
i think i'm missing http , https requests
i have variable contains url, example:
http(s)://website.com/a/b/file.html
i know if there's easy way make request uri data
to make http(s)request, here's have now:
- test if url http or https make appropriate request
- remove http(s):// part , put result in variable (if specify http or https in hostname, error)
- separate hostname path:
website.com
, `/a/b/file.html - put variables in options objects
is must or easier solutions don't involve getting out hostname , path, , testing if site in http or https ?
edit: can't use http.get need put specific options
in order components out of url need parse it. node v0.10.13 has stable module it: url.parse
Comments
Post a Comment