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:

  1. test if url http or https make appropriate request
  2. remove http(s):// part , put result in variable (if specify http or https in hostname, error)
  3. separate hostname path: website.com , `/a/b/file.html
  4. 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

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -