June 2014
Intermediate to advanced
696 pages
38h 52m
English
HTTP requests from a client include the URL string with the information shown in Figure 7.1. To be able to use the URL information more effectively, Node.js provides the url module, which provides functionality to convert a URL string into a URL object.
To create a URL object from a URL string, pass the URL string as the first parameter to the following method:
url.parse(urlStr, [parseQueryString], [slashesDenoteHost])
The url.parse() method takes the URL string as the first parameter. The parseQueryString parameter is a Boolean that when true also parses the query string portion of the URL into an object literal. The default is false. The slashesDenoteHost is also a Boolean that when ...
Read now
Unlock full access