Skip to content

doc: mention the behaviour if URL is invalid #2966

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions doc/api/http.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,12 @@ Node.js maintains several connections per server to make HTTP requests.
This function allows one to transparently issue requests.

`options` can be an object or a string. If `options` is a string, it is
automatically parsed with [url.parse()][].
automatically parsed with [url.parse()][] and it must be a valid complete URL,
including protocol and complete domain name or IP address.

**Note**: If the passed string is not in the valid URL format, then the
connection will be established to the default domain name, localhost, and on
the default port, 80. *This will be fixed soon.*

Options:

Expand Down Expand Up @@ -564,7 +569,7 @@ There are a few special headers that should be noted.
## http.get(options[, callback])

Since most requests are GET requests without bodies, Node.js provides this
convenience method. The only difference between this method and `http.request()`
convenience method. The only difference between this method and [http.request][]
is that it sets the method to GET and calls `req.end()` automatically.

Example:
Expand Down