A base URL: an absolute http:/https: URL with no query or fragment. Request
paths are appended to the base URL as a string, so a ? or # in it would
swallow every path (http://h/?x=1 requests /?x=1/opendata/..., http://h/#f
requests /). A malformed value (notaurl, "", http://) fails the parse.
A % in the user name or password must start a valid escape (%25 for a literal
one): the userinfo is decoded for the Authorization header, and Node failed at
request time ("URI malformed") as a network error. Surrounding whitespace (U+00A0
included) and control characters are rejected: new URL() trims or drops them
silently, but the raw string is what the request URL is built from.
A base URL: an absolute
http:/https:URL with no query or fragment. Request paths are appended to the base URL as a string, so a?or#in it would swallow every path (http://h/?x=1requests/?x=1/opendata/...,http://h/#frequests/). A malformed value (notaurl,"",http://) fails the parse. A%in the user name or password must start a valid escape (%25for a literal one): the userinfo is decoded for the Authorization header, and Node failed at request time ("URI malformed") as a network error. Surrounding whitespace (U+00A0 included) and control characters are rejected:new URL()trims or drops them silently, but the raw string is what the request URL is built from.