Discover url parse request url pathname, include the articles, news, trends, analysis and practical advice about url parse request url pathname on alibabacloud.com
The status of the book
What you are reading is already the final edition of this book. Therefore, updates are made only when error corrections are made and corresponding revisions are made to the new version node.js changes.
The code cases in this
The user interface and operating system name the files and directories using the system-related pathname string. This class renders an abstract, system-independent view of the hierarchical path name. The abstract path name has two components:An
Previous wordsIn the HTTP section, the knowledge of the URL is described in detail. The URL module in Nodejs provides some useful functions for URL processing and parsing. This article describes the URLs in Nodejs in detailURL ObjectThe parse URL
First, what is URL redirection?URL redirection (URL redirection, or Web address redirection or domain name forwarding) refers to the technology that directs a user to another URL when he or she browses a URL.Two, URL redirection how to configure?1)
Node. js ------ (Url, QueryString, Path) ModuleI. In the beginning, I analyzed the three modules in this article because they are not very long in length, and there is a dependency between them, so we will introduce and analyze the instance in
URL Module
URL module usage is very high when processing HTTP requests because the module allows URLs to be parsed, URLs to be generated, and stitching URLs. First, let's look at a complete URL for each component.
Copy Code code as follows:
Today, let's take a look at the related operation methods of the path in nodejs. In our development process, the paths are mainly URL paths used in browsers. Of course, this also contains operations related to QueryString query. The other is the
URL ModuleWe can use the. Parse method to convert a URL string to a URL object, as shown below.1. Description of each part of the URLvar url = require(‘url‘); //加载url模块url.parse(‘http://www.baidu.com‘);The returned result is:‘http:‘, slashes: null,
The URL module provides some tools for parsing URLsvar url = require (' URL ');A URL is a structured string that contains a number of meaningful parts. When the parsing is complete, a URL object (containing the properties of each section) is
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.