We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
querystring
url
url.parse(request.url, true)
pathname
method
request.method
GET
requestUrl.query.请求参数
POST
request.on(data, (data) => { //处理data} )
The text was updated successfully, but these errors were encountered:
No branches or pull requests
nodejs搭建服务器雏形的核心模块
querystring
和url
url
模块更强大,包括了解析字符串的方法,并且有更强大的方法url.parse(request.url, true)
url
内容很丰富,见图通过
url
的pathname
进一步判断路由通过
method
进行不同的请求request.method
获得方法名GET
的话,requestUrl.query.请求参数
判断请求的参数POST
的话,通过request.on(data, (data) => { //处理data} )
The text was updated successfully, but these errors were encountered: