Nodejs Web Request

Source: Internet
Author: User
Today to do Nodejs HTTP request, unexpectedly error The list argument must is an array of buffers I still code to identify the wrong value, I also deliberately nodejs to download a new version of it, The original is 6.9.1 under the latest 6.10.1 after entering no effect it is my last adjustment of the code, because the problem of Chinese garbled, Nodejs Web request garbled deliberately modified now unexpectedly error I used code test is not the value of the array that is what problem, find a long time also did not solve, Backstage suddenly think is not the array is not buffer it two parameters are detected really a not buffer know the problem can be solved by let CD = Null;res.on ("Data", (chunk) =>{if (Buffer.isbuffer ( Chunk) {if (CD) Buffer.concat ([CD, Chunk], cd.length + chunk.length); else cd = chunk;} Else{if (!CD) cd = '; CD + + Chunk;}}); That's no problem with code writing.


Original page http://www.web-jia.com/view.php?a=33


HTML 5 mobile App anatomy (1)
Developing PHP applications with NetBeans and Eclipse (1)
10 section php Common function code (1)
JavaScript asynchronous programming using Jscex to draw the circle
About PHP Arrays
On the application of Sina Weibo CSS3 details
HTML 5 Gorgeous new features
Switch of PHP control statements
Access methods and permissions for class members
How to load JavaScript in high-performance web development


Nodejs Web Request

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.