In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article is about how to solve the problem of error reporting in node. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Node 400error solution: 1, view the nodeJS request HTTP error information; 2, use the JavaScript encodeURI () function to encode the Chinese url, using syntax such as "encodeURI (URIstring)".
This article operating environment: Windows7 system, nodejs10.16.2 version, Dell G3 computer.
NodeJS request HTTP error: 4000.Please use the JavaScript encodeURI () function to encode the url containing Chinese
JavaScript Global object
Definition and usage
The encodeURI () function encodes the string as URI.
The syntax encodeURI (URIstring) parameter describes the URIstring required. A string containing URI or other text to be encoded. Return value
A copy of the URIstring in which some characters will be replaced by hexadecimal escape sequences.
Description
This method does not encode ASCII letters and numbers, nor does it encode these ASCII punctuation marks:-_. ! ~ * ().
The purpose of this method is to fully encode URI, so the encodeURI () function does not escape the following ASCII punctuation marks with special meaning in URI:; /?: @ & = + $, #
Tips and comments
Tip: if the URI component contains delimiters, such as? And #, you should use the encodeURIComponent () method to code each component separately.
Example
In this example, we will use encodeURI () to encode URI:
[xss_clean] (encodeURI ("http://www.w3school.com.cn")+") [xss_clean] (encodeURI ("http://www.w3school.com.cn/My first/")) [xss_clean] (encodeURI (", /?: @ & = + $#"))
Output:
Http://www.w3school.com.cnhttp://www.w3school.com.cn/My%20first/,/?:@&=+$#, thank you for your reading! This is the end of this article on "how to solve the problem of error reporting in node". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.