{"id":4710,"date":"2016-01-07T00:14:59","date_gmt":"2016-01-06T16:14:59","guid":{"rendered":"https:\/\/sdeno.com\/?p=4710"},"modified":"2016-01-07T00:20:46","modified_gmt":"2016-01-06T16:20:46","slug":"node-js-http%e6%a8%a1%e5%9d%97-%e4%bd%bf%e7%94%a8%e8%af%a6%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/sdeno.com\/?p=4710","title":{"rendered":"Node.js http\u6a21\u5757 \u4f7f\u7528\u8be6\u89e3"},"content":{"rendered":"<p><strong>\u76f4\u63a5\u901a\u8fc7http\u5bf9\u8c61\u4f7f\u7528\u7684\u6709\uff1a<\/strong><\/p>\n<p>\u4e00\u3001http.STATUS_CODES<\/p>\n<p>\u4e8c\u3001http.createServer<\/p>\n<p>\u4e09\u3001http.request(http.ClientRequest)<\/p>\n<p>\u56db\u3001http.get<\/p>\n<p>\u4e94\u3001http.globalAgent<\/p>\n<p>\u516d\u3001<a style=\"color: #ff8373;\" href=\"http:\/\/my.oschina.net\/antianlu\/blog\/261220\" target=\"_blank\" rel=\"nofollow\">http.IcomingMessage<\/a><\/p>\n<p><strong>\u4f5c\u4e3a\u56de\u8c03\u53c2\u6570\u4f7f\u7528\u7684\u5bf9\u8c61\u6709\uff1a<\/strong><\/p>\n<p>1.<a style=\"color: #ff8373;\" href=\"http:\/\/my.oschina.net\/antianlu\/blog\/261220\" target=\"_blank\" rel=\"nofollow\">http.serverRequest<\/a><\/p>\n<p>2.<a style=\"color: #ff8373;\" href=\"http:\/\/my.oschina.net\/antianlu\/blog\/260871\" target=\"_blank\" rel=\"nofollow\">http.serverResponse<\/a><\/p>\n<p>3.<a style=\"color: #ff8373;\" href=\"http:\/\/my.oschina.net\/antianlu\/blog\/261105\" target=\"_blank\" rel=\"nofollow\">http.Agent<\/a><\/p>\n<p>&nbsp;<\/p>\n<h3 style=\"font-weight: 600;\"><strong>\u4e00\u3001http.STATUS_CODES<\/strong><\/h3>\n<p>\u4f17\u6240\u5468\u77e5\uff0chttp\u670d\u52a1\u5668\u5c31\u662f\u4e00\u4e2a\u72b6\u6001\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u6839\u636e\u72b6\u6001\u7801\u6765\u786e\u5b9a\u670d\u52a1\u5668\u662f\u5904\u4e8e\u8bf7\u6c42\u7684\u4ec0\u4e48\u72b6\u6001\u3002\u5982\u4e0b\u5217\u51faNode.js status code\u7684\u5168\u90e8\u72b6\u6001\u5bf9\u4e8e\u7684\u89e3\u91ca\u3002<\/p>\n<div>\n<div id=\"highlighter_731311\" class=\"syntaxhighlighter  js\">\n<div class=\"toolbar\" style=\"font-weight: normal !important; font-style: normal !important; color: white !important;\"><a class=\"toolbar_item command_help help\" style=\"font-weight: normal !important; font-style: normal !important; color: white !important;\" href=\"http:\/\/my.oschina.net\/antianlu\/blog\/228511#\">?<\/a><\/div>\n<table style=\"font-weight: normal !important; font-style: normal !important;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td class=\"gutter\" style=\"font-weight: normal !important; font-style: normal !important; color: #afafaf !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">1<\/div>\n<div class=\"line number2 index1 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">2<\/div>\n<div class=\"line number3 index2 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">3<\/div>\n<div class=\"line number4 index3 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">4<\/div>\n<div class=\"line number5 index4 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">5<\/div>\n<div class=\"line number6 index5 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">6<\/div>\n<div class=\"line number7 index6 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">7<\/div>\n<div class=\"line number8 index7 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">8<\/div>\n<div class=\"line number9 index8 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">9<\/div>\n<div class=\"line number10 index9 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">10<\/div>\n<div class=\"line number11 index10 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">11<\/div>\n<div class=\"line number12 index11 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">12<\/div>\n<div class=\"line number13 index12 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">13<\/div>\n<div class=\"line number14 index13 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">14<\/div>\n<div class=\"line number15 index14 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">15<\/div>\n<div class=\"line number16 index15 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">16<\/div>\n<div class=\"line number17 index16 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">17<\/div>\n<div class=\"line number18 index17 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">18<\/div>\n<div class=\"line number19 index18 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">19<\/div>\n<div class=\"line number20 index19 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">20<\/div>\n<div class=\"line number21 index20 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">21<\/div>\n<div class=\"line number22 index21 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">22<\/div>\n<div class=\"line number23 index22 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">23<\/div>\n<div class=\"line number24 index23 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">24<\/div>\n<div class=\"line number25 index24 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">25<\/div>\n<div class=\"line number26 index25 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">26<\/div>\n<div class=\"line number27 index26 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">27<\/div>\n<div class=\"line number28 index27 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">28<\/div>\n<div class=\"line number29 index28 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">29<\/div>\n<div class=\"line number30 index29 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">30<\/div>\n<div class=\"line number31 index30 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">31<\/div>\n<div class=\"line number32 index31 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">32<\/div>\n<div class=\"line number33 index32 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">33<\/div>\n<div class=\"line number34 index33 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">34<\/div>\n<div class=\"line number35 index34 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">35<\/div>\n<div class=\"line number36 index35 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">36<\/div>\n<div class=\"line number37 index36 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">37<\/div>\n<div class=\"line number38 index37 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">38<\/div>\n<div class=\"line number39 index38 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">39<\/div>\n<div class=\"line number40 index39 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">40<\/div>\n<div class=\"line number41 index40 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">41<\/div>\n<div class=\"line number42 index41 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">42<\/div>\n<div class=\"line number43 index42 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">43<\/div>\n<div class=\"line number44 index43 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">44<\/div>\n<div class=\"line number45 index44 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">45<\/div>\n<div class=\"line number46 index45 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">46<\/div>\n<div class=\"line number47 index46 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">47<\/div>\n<div class=\"line number48 index47 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">48<\/div>\n<div class=\"line number49 index48 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">49<\/div>\n<div class=\"line number50 index49 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">50<\/div>\n<div class=\"line number51 index50 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">51<\/div>\n<div class=\"line number52 index51 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">52<\/div>\n<div class=\"line number53 index52 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">53<\/div>\n<div class=\"line number54 index53 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">54<\/div>\n<div class=\"line number55 index54 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">55<\/div>\n<div class=\"line number56 index55 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">56<\/div>\n<div class=\"line number57 index56 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">57<\/div>\n<div class=\"line number58 index57 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">58<\/div>\n<div class=\"line number59 index58 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">59<\/div>\n<div class=\"line number60 index59 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">60<\/div>\n<\/td>\n<td class=\"code\" style=\"font-weight: normal !important; font-style: normal !important;\">\n<div class=\"container\" style=\"font-weight: normal !important; font-style: normal !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">http:\u00a0{<\/code><\/div>\n<div class=\"line number2 index1 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">STATUS_CODES:\u00a0{<\/code><\/div>\n<div class=\"line number3 index2 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'100'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Continue'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number4 index3 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'101'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Switching\u00a0Protocols'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number5 index4 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'102'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Processing'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number6 index5 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'200'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'OK'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number7 index6 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'201'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Created'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number8 index7 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'202'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Accepted'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number9 index8 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'203'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Non-Authoritative\u00a0Information'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number10 index9 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'204'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'No\u00a0Content'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number11 index10 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'205'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Reset\u00a0Content'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number12 index11 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'206'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Partial\u00a0Content'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number13 index12 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'207'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Multi-Status'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number14 index13 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'300'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Multiple\u00a0Choices'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number15 index14 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'301'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Moved\u00a0Permanently'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number16 index15 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'302'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Moved\u00a0Temporarily'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number17 index16 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'303'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'See\u00a0Other'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number18 index17 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'304'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Not\u00a0Modified'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number19 index18 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'305'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Use\u00a0Proxy'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number20 index19 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'307'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Temporary\u00a0Redirect'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number21 index20 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'400'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Bad\u00a0Request'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number22 index21 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'401'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Unauthorized'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number23 index22 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'402'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Payment\u00a0Required'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number24 index23 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'403'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Forbidden'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number25 index24 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'404'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Not\u00a0Found'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number26 index25 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'405'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Method\u00a0Not\u00a0Allowed'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number27 index26 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'406'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Not\u00a0Acceptable'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number28 index27 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'407'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Proxy\u00a0Authentication\u00a0Required'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number29 index28 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'408'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Request\u00a0Time-out'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number30 index29 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'409'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Conflict'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number31 index30 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'410'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Gone'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number32 index31 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'411'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Length\u00a0Required'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number33 index32 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'412'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Precondition\u00a0Failed'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number34 index33 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'413'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Request\u00a0Entity\u00a0Too\u00a0Large'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number35 index34 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'414'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Request-URI\u00a0Too\u00a0Large'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number36 index35 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'415'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Unsupported\u00a0Media\u00a0Type'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number37 index36 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'416'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Requested\u00a0Range\u00a0Not\u00a0Satisfiable'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number38 index37 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'417'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Expectation\u00a0Failed'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number39 index38 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'418'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'I\\'m\u00a0a\u00a0teapot'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number40 index39 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'422'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Unprocessable\u00a0Entity'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number41 index40 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'423'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Locked'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number42 index41 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'424'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Failed\u00a0Dependency'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number43 index42 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'425'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Unordered\u00a0Collection'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number44 index43 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'426'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Upgrade\u00a0Required'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number45 index44 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'428'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Precondition\u00a0Required'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number46 index45 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'429'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Too\u00a0Many\u00a0Requests'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number47 index46 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'431'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Request\u00a0Header\u00a0Fields\u00a0Too\u00a0Large'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number48 index47 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'500'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Internal\u00a0Server\u00a0Error'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number49 index48 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'501'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Not\u00a0Implemented'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number50 index49 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'502'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Bad\u00a0Gateway'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number51 index50 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'503'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Service\u00a0Unavailable'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number52 index51 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'504'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Gateway\u00a0Time-out'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number53 index52 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'505'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'HTTP\u00a0Version\u00a0Not\u00a0Supported'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number54 index53 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'506'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Variant\u00a0Also\u00a0Negotiates'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number55 index54 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'507'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Insufficient\u00a0Storage'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number56 index55 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'509'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Bandwidth\u00a0Limit\u00a0Exceeded'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number57 index56 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'510'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Not\u00a0Extended'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number58 index57 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'511'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Network\u00a0Authentication\u00a0Required'<\/code><\/div>\n<div class=\"line number59 index58 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">}<\/code><\/div>\n<div class=\"line number60 index59 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">}<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p>\u6d4b\u8bd5\u7528\u4f8b\uff1a<\/p>\n<div>\n<div id=\"highlighter_574624\" class=\"syntaxhighlighter  js\">\n<div class=\"toolbar\" style=\"font-weight: normal !important; font-style: normal !important; color: white !important;\"><a class=\"toolbar_item command_help help\" style=\"font-weight: normal !important; font-style: normal !important; color: white !important;\" href=\"http:\/\/my.oschina.net\/antianlu\/blog\/228511#\">?<\/a><\/div>\n<table style=\"font-weight: normal !important; font-style: normal !important;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td class=\"gutter\" style=\"font-weight: normal !important; font-style: normal !important; color: #afafaf !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">1<\/div>\n<div class=\"line number2 index1 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">2<\/div>\n<div class=\"line number3 index2 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">3<\/div>\n<div class=\"line number4 index3 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">4<\/div>\n<div class=\"line number5 index4 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">5<\/div>\n<div class=\"line number6 index5 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">6<\/div>\n<div class=\"line number7 index6 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">7<\/div>\n<div class=\"line number8 index7 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">8<\/div>\n<div class=\"line number9 index8 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">9<\/div>\n<div class=\"line number10 index9 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\">10<\/div>\n<div class=\"line number11 index10 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\">11<\/div>\n<\/td>\n<td class=\"code\" style=\"font-weight: normal !important; font-style: normal !important;\">\n<div class=\"container\" style=\"font-weight: normal !important; font-style: normal !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">var<\/code>\u00a0<code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">http\u00a0=\u00a0require(<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'http'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">);<\/code><\/div>\n<div class=\"line number2 index1 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><\/div>\n<div class=\"line number3 index2 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">http.createServer(<\/code><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">function<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">(req,res){<\/code><\/div>\n<div class=\"line number4 index3 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0<\/code><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">var<\/code>\u00a0<code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">status\u00a0=\u00a0req.url.substr(1);<\/code><\/div>\n<div class=\"line number5 index4 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">if<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">(\u00a0!\u00a0http.STATUS_CODES[status])<\/code><\/div>\n<div class=\"line number6 index5 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">{<\/code><\/div>\n<div class=\"line number7 index6 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">status\u00a0=\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'404'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">;<\/code><\/div>\n<div class=\"line number8 index7 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">}<\/code><\/div>\n<div class=\"line number9 index8 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">res.writeHeader(status,{<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Content-Type'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'text\/plain'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">});<\/code><\/div>\n<div class=\"line number10 index9 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">res.end(http.STATUS_CODES[status]);<\/code><\/div>\n<div class=\"line number11 index10 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">}).listen(3000);<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p>\u6d4b\u8bd5\u8fde\u63a5\uff1a<a style=\"color: #ff8373;\" href=\"http:\/\/localhost:3000\/500\" rel=\"nofollow\">http:\/\/localhost:3000\/500<\/a>\u00a0 \u7ed3\u679c\u8f93\u51fa\u00a0<a style=\"color: #ff8373;\" rel=\"nofollow\">Internal\u00a0Server\u00a0Error<\/a><\/p>\n<h3 style=\"font-weight: 600;\"><strong>\u4e8c\u3001http.createServer<\/strong><\/h3>\n<p>http.createServer\u662f\u521b\u5efa\u4e00\u53f0web\u670d\u52a1\u5668\u7684\u5173\u952e\u6240\u5728\uff0c\u662f\u5904\u7406\u8bf7\u6c42\u548c\u56de\u5e94\u7684\u4e3b\u51fd\u6570\u51fa\u53e3\u548c\u51fa\u53e3\uff0c\u6211\u4eec\u628ahttp.createServer\u521b\u5efa\u7684\u670d\u52a1\u5bf9\u8c61\u5b9a\u4e49\u4e3aserver.\u4ee3\u7801\u5982\u4e0b\u3002<\/p>\n<div>\n<div id=\"highlighter_518266\" class=\"syntaxhighlighter  js\">\n<div class=\"toolbar\" style=\"font-weight: normal !important; font-style: normal !important; color: white !important;\"><a class=\"toolbar_item command_help help\" style=\"font-weight: normal !important; font-style: normal !important; color: white !important;\" href=\"http:\/\/my.oschina.net\/antianlu\/blog\/228511#\">?<\/a><\/div>\n<div>\n<div id=\"highlighter_518266\" class=\"syntaxhighlighter  js\">\n<table style=\"font-weight: normal !important; font-style: normal !important;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody style=\"font-weight: normal !important; font-style: normal !important;\">\n<tr style=\"font-weight: normal !important; font-style: normal !important;\">\n<td class=\"code\" style=\"font-weight: normal !important; font-style: normal !important;\">\n<div class=\"container\" style=\"font-weight: normal !important; font-style: normal !important;\">\n<div class=\"line number1 index0 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/**<\/code><\/div>\n<div class=\"line number2 index1 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0Created\u00a0by\u00a0Administrator\u00a0on\u00a014-4-29.<\/code><\/div>\n<div class=\"line number3 index2 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\/<\/code><\/div>\n<div class=\"line number4 index3 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><\/div>\n<div class=\"line number5 index4 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">var<\/code>\u00a0<code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">http\u00a0=\u00a0require(<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'http'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">);<\/code><\/div>\n<div class=\"line number6 index5 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><\/div>\n<div class=\"line number7 index6 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/**<\/code><\/div>\n<div class=\"line number8 index7 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u521b\u5efa\u670d\u52a1\u5668\u7684\u4e24\u79cd\u5199\u6cd5\uff0c\u7b2c\u4e00\u79cd\u5199\u6cd5\u5982\u4e0b<\/code><\/div>\n<div class=\"line number9 index8 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u7531\u4e8eserver\u5df2\u7ecf\u7ee7\u627f\u4e86EventEmitter\u7684\u4e8b\u4ef6\u529f\u80fd\uff0c\u6240\u4ee5\u53ef\u4ee5\u4f7f\u7528\u9ad8\u7ea7\u51fd\u6570\u7f16\u5199\u65b9\u5f0f\u76d1\u63a7\u4e8b\u4ef6<\/code><\/div>\n<div class=\"line number10 index9 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{Function}\u00a0request\u00a0event<\/code><\/div>\n<div class=\"line number11 index10 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\/<\/code><\/div>\n<div class=\"line number12 index11 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">var<\/code>\u00a0<code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">server\u00a0=\u00a0http.createServer(<\/code><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">function<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">(req,res)<\/code><\/div>\n<div class=\"line number13 index12 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">{<\/code><\/div>\n<div class=\"line number14 index13 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/\/\u8fd9\u91cc\u7684req\u4e3ahttp.serverRequest<\/code><\/div>\n<div class=\"line number15 index14 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">res.writeHeader(200,{<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Content-Type'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'text\/plain'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">});<\/code><\/div>\n<div class=\"line number16 index15 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">res.end(<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'hello\u00a0world'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">);<\/code><\/div>\n<div class=\"line number17 index16 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">});<\/code><\/div>\n<div class=\"line number18 index17 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><\/div>\n<div class=\"line number19 index18 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><\/div>\n<div class=\"line number20 index19 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/**<\/code><\/div>\n<div class=\"line number21 index20 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u8bf4\u660e\uff1a\u521b\u5efa\u670d\u52a1\u5668\u7684\u7b2c\u4e8c\u79cd\u5199\u6cd5<\/code><\/div>\n<div class=\"line number22 index21 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u6709\u5173server\u5bf9\u8c61\u7684\u4e8b\u4ef6\u76d1\u542c<\/code><\/div>\n<div class=\"line number23 index22 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{Object}\u00a0req\u00a0\u662fhttp.IncomingMessag\u7684\u4e00\u4e2a\u5b9e\u4f8b\uff0c\u5728keep-alive\u8fde\u63a5\u4e2d\u652f\u6301\u591a\u4e2a\u8bf7\u6c42<\/code><\/div>\n<div class=\"line number24 index23 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{Object}\u00a0res\u00a0\u662fhttp.ServerResponse\u7684\u4e00\u4e2a\u5b9e\u4f8b<\/code><\/div>\n<div class=\"line number25 index24 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\/<\/code><\/div>\n<div class=\"line number26 index25 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">var<\/code>\u00a0<code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">server\u00a0=\u00a0<\/code><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">new<\/code>\u00a0<code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">http.Server();<\/code><\/div>\n<div class=\"line number27 index26 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">server.on(<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'request'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">function<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">(req,res){<\/code><\/div>\n<div class=\"line number28 index27 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">res.writeHeader(200,{<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Content-Type'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">:<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'text\/plain'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">});<\/code><\/div>\n<div class=\"line number29 index28 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">res.end(<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'hello\u00a0world'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">);<\/code><\/div>\n<div class=\"line number30 index29 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">});<\/code><\/div>\n<div class=\"line number31 index30 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><\/div>\n<div class=\"line number32 index31 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/**<\/code><\/div>\n<div class=\"line number33 index32 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u8bf4\u660e\uff1a\u65b0\u7684TCP\u6d41\u5efa\u7acb\u65f6\u51fa\u53d1\u3002\u00a0socket\u662f\u4e00\u4e2anet.Socket\u5bf9\u8c61\u3002\u00a0\u901a\u5e38\u7528\u6237\u65e0\u9700\u5904\u7406\u8be5\u4e8b\u4ef6\u3002<\/code><\/div>\n<div class=\"line number34 index33 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u7279\u522b\u6ce8\u610f\uff0c\u534f\u8bae\u89e3\u6790\u5668\u7ed1\u5b9a\u5957\u63a5\u5b57\u65f6\u91c7\u7528\u7684\u65b9\u5f0f\u4f7f\u5957\u63a5\u5b57\u4e0d\u4f1a\u51fa\u53d1readable\u4e8b\u4ef6\u3002\u00a0\u8fd8\u53ef\u4ee5\u901a\u8fc7request.connection\u8bbf\u95eesocket\u3002<\/code><\/div>\n<div class=\"line number35 index34 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{Object}\u00a0socket<\/code><\/div>\n<div class=\"line number36 index35 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\/<\/code><\/div>\n<div class=\"line number37 index36 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">server.on(<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'connection'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">function<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">(socket){});<\/code><\/div>\n<div class=\"line number38 index37 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><\/div>\n<div class=\"line number39 index38 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/**<\/code><\/div>\n<div class=\"line number40 index39 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u6e90API:\u00a0Event:\u00a0'close'<\/code><\/div>\n<div class=\"line number41 index40 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u8bf4\u660e\uff1a\u5173\u95ed\u670d\u52a1\u5668\u65f6\u89e6\u53d1<\/code><\/div>\n<div class=\"line number42 index41 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\/<\/code><\/div>\n<div class=\"line number43 index42 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">server.on(<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'close'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">function<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">(){});<\/code><\/div>\n<div class=\"line number44 index43 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><\/div>\n<div class=\"line number45 index44 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/**<\/code><\/div>\n<div class=\"line number46 index45 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u8bf4\u660e\uff1a\u6bcf\u5f53\u6536\u5230Expect:\u00a0100-continue\u7684http\u8bf7\u6c42\u65f6\u89e6\u53d1\u3002\u00a0\u5982\u679c\u672a\u76d1\u542c\u8be5\u4e8b\u4ef6\uff0c\u670d\u52a1\u5668\u4f1a\u914c\u60c5\u81ea\u52a8\u53d1\u9001100\u00a0Continue\u54cd\u5e94\u3002<\/code><\/div>\n<div class=\"line number47 index46 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u5904\u7406\u8be5\u4e8b\u4ef6\u65f6\uff0c\u5982\u679c\u5ba2\u6237\u7aef\u53ef\u4ee5\u7ee7\u7eed\u53d1\u9001\u8bf7\u6c42\u4e3b\u4f53\u5219\u8c03\u7528response.writeContinue\uff0c\u00a0\u5982\u679c\u4e0d\u80fd\u5219\u751f\u6210\u5408\u9002\u7684HTTP\u54cd\u5e94\uff08\u4f8b\u5982\uff0c400\u00a0\u8bf7\u6c42\u65e0\u6548\uff09<\/code><\/div>\n<div class=\"line number48 index47 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u9700\u8981\u6ce8\u610f\u5230,\u00a0\u5f53\u8fd9\u4e2a\u4e8b\u4ef6\u89e6\u53d1\u5e76\u4e14\u88ab\u5904\u7406\u540e,\u00a0request\u00a0\u4e8b\u4ef6\u5c06\u4e0d\u518d\u4f1a\u89e6\u53d1.<\/code><\/div>\n<div class=\"line number49 index48 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{Object}\u00a0req<\/code><\/div>\n<div class=\"line number50 index49 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{Object}\u00a0req<\/code><\/div>\n<div class=\"line number51 index50 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\/<\/code><\/div>\n<div class=\"line number52 index51 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">server.on(<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'checkContinue'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">function<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">(req,res){});<\/code><\/div>\n<div class=\"line number53 index52 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><\/div>\n<div class=\"line number54 index53 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/**<\/code><\/div>\n<div class=\"line number55 index54 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u8bf4\u660e\uff1a\u5982\u679c\u5ba2\u6237\u7aef\u53d1\u8d77connect\u8bf7\u6c42\uff0c\u5982\u679c\u670d\u52a1\u5668\u7aef\u6ca1\u6709\u76d1\u542c\uff0c\u90a3\u4e48\u4e8e\u5ba2\u6237\u7aef\u8bf7\u6c42\u7684\u8be5\u8fde\u63a5\u5c06\u4f1a\u88ab\u5173\u95ed<\/code><\/div>\n<div class=\"line number56 index55 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{Object}\u00a0req\u00a0\u662f\u8be5HTTP\u8bf7\u6c42\u7684\u53c2\u6570\uff0c\u4e0erequest\u4e8b\u4ef6\u4e2d\u7684\u76f8\u540c\u3002<\/code><\/div>\n<div class=\"line number57 index56 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{Object}\u00a0socket\u00a0\u662f\u670d\u52a1\u7aef\u4e0e\u5ba2\u6237\u7aef\u4e4b\u95f4\u7684\u7f51\u7edc\u5957\u63a5\u5b57\u3002\u9700\u8981\u81ea\u5df1\u5199\u4e00\u4e2adata\u4e8b\u4ef6\u76d1\u542c\u6570\u636e\u6d41<\/code><\/div>\n<div class=\"line number58 index57 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{Object}\u00a0head\u00a0\u662f\u4e00\u4e2aBuffer\u5b9e\u4f8b\uff0c\u96a7\u9053\u6d41\u7684\u7b2c\u4e00\u4e2a\u5305\uff0c\u8be5\u53c2\u6570\u53ef\u80fd\u4e3a\u7a7a\u3002<\/code><\/div>\n<div class=\"line number59 index58 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\/<\/code><\/div>\n<div class=\"line number60 index59 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">server.on(<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'connect'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">function<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">(req,socket,head){});<\/code><\/div>\n<div class=\"line number61 index60 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><\/div>\n<div class=\"line number62 index61 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/**<\/code><\/div>\n<div class=\"line number63 index62 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u8bf4\u660e\uff1a\u8fd9\u4e2a\u4e8b\u4ef6\u4e3b\u8981\u662f\u5bf9HTTP\u534f\u8bae\u5347\u7ea7\u4e3a\u5176\u4ed6\u534f\u8bae\u540e\u7684\u4e8b\u4ef6\u76d1\u542c\uff0c\u5982\u679c\u670d\u52a1\u5668\u7aef\u6ca1\u6709\u76d1\u542c\uff0c\u90a3\u4e48\u4e8e\u5ba2\u6237\u7aef\u8bf7\u6c42\u7684\u8be5\u8fde\u63a5\u5c06\u4f1a\u88ab\u5173\u95ed<\/code><\/div>\n<div class=\"line number64 index63 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{Object}\u00a0req\u00a0\u662f\u8be5HTTP\u8bf7\u6c42\u7684\u53c2\u6570\uff0c\u4e0erequest\u4e8b\u4ef6\u4e2d\u7684\u76f8\u540c\u3002<\/code><\/div>\n<div class=\"line number65 index64 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{Object}\u00a0socket\u00a0\u662f\u670d\u52a1\u7aef\u4e0e\u5ba2\u6237\u7aef\u4e4b\u95f4\u7684\u7f51\u7edc\u5957\u63a5\u5b57\u3002\u9700\u8981\u81ea\u5df1\u5199\u4e00\u4e2adata\u4e8b\u4ef6\u76d1\u542c\u6570\u636e\u6d41<\/code><\/div>\n<div class=\"line number66 index65 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{Object}\u00a0head\u00a0\u662f\u4e00\u4e2aBuffer\u5b9e\u4f8b\uff0c\u5347\u7ea7\u540e\u6d41\u7684\u7b2c\u4e00\u4e2a\u5305\uff0c\u8be5\u53c2\u6570\u53ef\u80fd\u4e3a\u7a7a\u3002<\/code><\/div>\n<div class=\"line number67 index66 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\/<\/code><\/div>\n<div class=\"line number68 index67 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">server.on(<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'upgrade'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">function<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">(req,socket,head){});<\/code><\/div>\n<div class=\"line number69 index68 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><\/div>\n<div class=\"line number70 index69 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/**<\/code><\/div>\n<div class=\"line number71 index70 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u8bf4\u660e\uff1a\u5982\u679c\u4e00\u4e2a\u5ba2\u6237\u7aef\u8fde\u63a5\u89e6\u53d1\u4e86\u4e00\u4e2a\u00a0'error'\u00a0\u4e8b\u4ef6,\u00a0\u5b83\u5c31\u4f1a\u8f6c\u53d1\u5230\u8fd9\u91cc<\/code><\/div>\n<div class=\"line number72 index71 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{Object}\u00a0exception<\/code><\/div>\n<div class=\"line number73 index72 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{Object}\u00a0socket<\/code><\/div>\n<div class=\"line number74 index73 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\/<\/code><\/div>\n<div class=\"line number75 index74 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">server.on(<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'clientError'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">function<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">(exception,socket){});<\/code><\/div>\n<div class=\"line number76 index75 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><\/div>\n<div class=\"line number77 index76 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/**<\/code><\/div>\n<div class=\"line number78 index77 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u6e90API\uff1aserver.listen(port,\u00a0[hostname],\u00a0[backlog],\u00a0[callback])<\/code><\/div>\n<div class=\"line number79 index78 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u8bf4\u660e\uff1a\u76d1\u542c\u4e00\u4e2a\u00a0unix\u00a0socket,\u00a0\u9700\u8981\u63d0\u4f9b\u4e00\u4e2a\u6587\u4ef6\u540d\u800c\u4e0d\u662f\u7aef\u53e3\u53f7\u548c\u4e3b\u673a\u540d\u3002<\/code><\/div>\n<div class=\"line number80 index79 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{Number}\u00a0port\u00a0\u7aef\u53e3<\/code><\/div>\n<div class=\"line number81 index80 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{String}\u00a0host\u00a0\u4e3b\u673a<\/code><\/div>\n<div class=\"line number82 index81 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{Number}\u00a0backlog\u00a0\u7b49\u5f85\u961f\u5217\u7684\u6700\u5927\u957f\u5ea6\uff0c\u51b3\u5b9a\u4e8e\u64cd\u4f5c\u7cfb\u7edf\u5e73\u53f0\uff0c\u9ed8\u8ba4\u662f511<\/code><\/div>\n<div class=\"line number83 index82 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{Function}\u00a0callback\u00a0\u5f02\u6b65\u56de\u8c03\u51fd\u6570<\/code><\/div>\n<div class=\"line number84 index83 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\/<\/code><\/div>\n<div class=\"line number85 index84 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/\/server.listen(3000,'localhost',100,function(){});<\/code><\/div>\n<div class=\"line number86 index85 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><\/div>\n<div class=\"line number87 index86 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/**<\/code><\/div>\n<div class=\"line number88 index87 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u6e90API\uff1aserver.listen(path,\u00a0[callback])<\/code><\/div>\n<div class=\"line number89 index88 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u8bf4\u660e\uff1a\u542f\u52a8\u4e00\u4e2a\u00a0UNIX\u00a0\u5957\u63a5\u5b57\u670d\u52a1\u5668\u5728\u6240\u7ed9\u8def\u5f84\u00a0path\u00a0\u4e0a\u76d1\u542c\u8fde\u63a5\u3002<\/code><\/div>\n<div class=\"line number90 index89 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u53ef\u80fd\u7528\u5904\uff1a\u591a\u8def\u5f84\u6216\u6e20\u9053\u6570\u636e\u6765\u6e90\u76d1\u542c\u5206\u9694<\/code><\/div>\n<div class=\"line number91 index90 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{String}\u00a0path<\/code><\/div>\n<div class=\"line number92 index91 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{Function}\u00a0callback<\/code><\/div>\n<div class=\"line number93 index92 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\/<\/code><\/div>\n<div class=\"line number94 index93 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/\/server.listen('path',function(){})<\/code><\/div>\n<div class=\"line number95 index94 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><\/div>\n<div class=\"line number96 index95 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/**<\/code><\/div>\n<div class=\"line number97 index96 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u6e90API\uff1aserver.listen(handle,\u00a0[callback])<\/code><\/div>\n<div class=\"line number98 index97 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u8bf4\u660e\uff1aWindows\u00a0\u4e0d\u652f\u6301\u76d1\u542c\u4e00\u4e2a\u6587\u4ef6\u63cf\u8ff0\u7b26\u3002<\/code><\/div>\n<div class=\"line number99 index98 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{Object}\u00a0handle\u00a0\u53d8\u91cf\u53ef\u4ee5\u88ab\u8bbe\u7f6e\u4e3aserver\u00a0\u6216\u8005\u00a0socket<\/code><\/div>\n<div class=\"line number100 index99 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{Function}\u00a0callback<\/code><\/div>\n<div class=\"line number101 index100 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\/<\/code><\/div>\n<div class=\"line number102 index101 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/\/server.listen({},function(){});<\/code><\/div>\n<div class=\"line number103 index102 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><\/div>\n<div class=\"line number104 index103 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/**<\/code><\/div>\n<div class=\"line number105 index104 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u8bf4\u660e\uff1a\u6700\u5927\u8bf7\u6c42\u5934\u6570\u76ee\u9650\u5236,\u00a0\u9ed8\u8ba4\u00a01000\u00a0\u4e2a.\u00a0\u5982\u679c\u8bbe\u7f6e\u4e3a0,\u00a0\u5219\u4ee3\u8868\u4e0d\u505a\u4efb\u4f55\u9650\u5236.<\/code><\/div>\n<div class=\"line number106 index105 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@type\u00a0{number}<\/code><\/div>\n<div class=\"line number107 index106 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\/<\/code><\/div>\n<div class=\"line number108 index107 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">server.maxHeadersCount\u00a0=\u00a01000;<\/code><\/div>\n<div class=\"line number109 index108 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><\/div>\n<div class=\"line number110 index109 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/**<\/code><\/div>\n<div class=\"line number111 index110 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u6e90API\uff1aserver.setTimeout(msecs,\u00a0callback)<\/code><\/div>\n<div class=\"line number112 index111 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u8bf4\u660e\uff1a\u4e3a\u5957\u63a5\u5b57\u8bbe\u5b9a\u8d85\u65f6\u503c\u3002\u5982\u679c\u4e00\u4e2a\u8d85\u65f6\u53d1\u751f\uff0c\u90a3\u4e48Server\u5bf9\u8c61\u4e0a\u4f1a\u5206\u53d1\u4e00\u4e2a'timeout'\u4e8b\u4ef6\uff0c\u540c\u65f6\u5c06\u5957\u63a5\u5b57\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\u3002<\/code><\/div>\n<div class=\"line number113 index112 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u8bbe\u7f6e\u4e3a0\u5c06\u963b\u6b62\u4e4b\u540e\u5efa\u7acb\u7684\u8fde\u63a5\u7684\u4e00\u5207\u81ea\u52a8\u8d85\u65f6\u884c\u4e3a<\/code><\/div>\n<div class=\"line number114 index113 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{Number}\u00a0msecs<\/code><\/div>\n<div class=\"line number115 index114 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param<\/code><\/div>\n<div class=\"line number116 index115 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\/<\/code><\/div>\n<div class=\"line number117 index116 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">server.setTimeout(1000,<\/code><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">function<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">(){});<\/code><\/div>\n<div class=\"line number118 index117 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><\/div>\n<div class=\"line number119 index118 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/**<\/code><\/div>\n<div class=\"line number120 index119 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u8bf4\u660e\uff1a\u4e00\u4e2a\u5957\u63a5\u5b57\u88ab\u5224\u65ad\u4e3a\u8d85\u65f6\u4e4b\u524d\u7684\u95f2\u7f6e\u6beb\u79d2\u6570\u3002\u00a0\u9ed8\u8ba4\u00a0120000\u00a0(2\u00a0\u5206\u949f)<\/code><\/div>\n<div class=\"line number121 index120 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@type\u00a0{number}<\/code><\/div>\n<div class=\"line number122 index121 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\/<\/code><\/div>\n<div class=\"line number123 index122 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">server.timeout\u00a0=\u00a0120000;<\/code><\/div>\n<div class=\"line number124 index123 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><\/div>\n<div class=\"line number125 index124 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/**<\/code><\/div>\n<div class=\"line number126 index125 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u8bf4\u660e\uff1a\u8fd9\u91cc\u7684\u4e3b\u673a\u5c06\u662f\u672c\u5730<\/code><\/div>\n<div class=\"line number127 index126 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{Number}\u00a0port\u00a0\u7aef\u53e3<\/code><\/div>\n<div class=\"line number128 index127 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{Function}\u00a0callback\u00a0\u5f02\u6b65\u56de\u8c03\u51fd\u6570<\/code><\/div>\n<div class=\"line number129 index128 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\/<\/code><\/div>\n<div class=\"line number130 index129 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">server.listen(3000,<\/code><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">function<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">(){<\/code><\/div>\n<div class=\"line number131 index130 alt2\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">console.log(<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'Listen\u00a0port\u00a03000'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">);<\/code><\/div>\n<div class=\"line number132 index131 alt1\" style=\"font-weight: normal !important; font-style: normal !important;\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">});<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3 style=\"font-weight: 600;\"><strong>\u4e09 \u3001http.request<\/strong><\/h3>\n<p>http \u6a21\u5757\u63d0\u4f9b\u4e86\u4e24\u4e2a\u51fd\u6570 http.request \u548c http.get\uff0c\u529f\u80fd\u662f\u4f5c\u4e3a\u5ba2\u6237\u7aef\u5411 HTTP\u670d\u52a1\u5668\u53d1\u8d77\u8bf7\u6c42\u3002http.request(options, callback) \u53d1\u8d77 HTTP \u8bf7\u6c42\u3002\u63a5\u53d7\u4e24\u4e2a\u53c2\u6570\uff0coption \u662f\u4e00\u4e2a\u7c7b\u4f3c\u5173\u8054\u6570\u7ec4\u7684\u5bf9\u8c61\uff0c\u8868\u793a\u8bf7\u6c42\u7684\u53c2\u6570\uff0ccallback \u662f\u8bf7\u6c42\u7684\u56de\u8c03\u51fd\u6570\u3002option\u5e38\u7528\u7684\u53c2\u6570\u5982\u4e0b\u6240\u793a\u3002\u00a0http.request \u8fd4\u56de\u4e00\u4e2a http.ClientRequest \u7684\u5b9e\u4f8b\u3002<\/p>\n<div>\n<div id=\"highlighter_471902\" class=\"syntaxhighlighter  js\">\n<div class=\"toolbar\" style=\"font-weight: normal !important; font-style: normal !important; color: white !important;\"><a class=\"toolbar_item command_help help\" style=\"font-weight: normal !important; font-style: normal !important; color: white !important;\" href=\"http:\/\/my.oschina.net\/antianlu\/blog\/228511#\">?<\/a><\/div>\n<div class=\"line number1 index0 alt2\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/**<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0Created\u00a0by\u00a0Administrator\u00a0on\u00a014-4-30.<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\/<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">var<\/code>\u00a0<code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">http\u00a0=\u00a0require(<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'http'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">);<\/code><\/div>\n<div class=\"line number6 index5 alt1\"><\/div>\n<div class=\"line number7 index6 alt2\"><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">var<\/code>\u00a0<code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">server\u00a0=\u00a0http.createServer(<\/code><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">function<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">(req,res){<\/code><\/div>\n<div class=\"line number8 index7 alt1\"><\/div>\n<div class=\"line number9 index8 alt2\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">}).listen(3000);<\/code><\/div>\n<div class=\"line number10 index9 alt1\"><\/div>\n<div class=\"line number11 index10 alt2\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/**<\/code><\/div>\n<div class=\"line number12 index11 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u53c2\u6570\u914d\u7f6e<\/code><\/div>\n<div class=\"line number13 index12 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@type\u00a0{{hostname:\u00a0string,\u00a0port:\u00a0number,\u00a0method:\u00a0string,\u00a0path:\u00a0string,handers:\u00a0{}}}<\/code><\/div>\n<div class=\"line number14 index13 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0host:\u8bf7\u6c42\u7684\u670d\u52a1\u5668\u57df\u540d\u6216\u8005IP\u5730\u5740<\/code><\/div>\n<div class=\"line number15 index14 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0port:\u7aef\u53e3<\/code><\/div>\n<div class=\"line number16 index15 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0method:\u8bf7\u6c42\u65b9\u5f0f\u6709POST,GET,INPUT,DELETE,CONNECT\uff0c\u9ed8\u8ba4\u4e3aGET<\/code><\/div>\n<div class=\"line number17 index16 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0path\uff1a\u8bf7\u6c42\u5730\u5740\uff0c\u53ef\u5305\u542b\u67e5\u8be2\u5b57\u7b26\u4e32\u4ee5\u53ca\u53ef\u80fd\u5b58\u5728\u7684\u951a\u70b9\u3002\u4f8b\u5982'\/index.html?page=12'<\/code><\/div>\n<div class=\"line number18 index17 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0handers:\u00a0\u4e00\u4e2a\u5305\u542b\u8bf7\u6c42\u5934\u7684\u5bf9\u8c61\u3002<\/code><\/div>\n<div class=\"line number19 index18 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\/<\/code><\/div>\n<div class=\"line number20 index19 alt1\"><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">var<\/code>\u00a0<code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">options\u00a0=<\/code><\/div>\n<div class=\"line number21 index20 alt2\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">{<\/code><\/div>\n<div class=\"line number22 index21 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">hostname\u00a0:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'www.google.com'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number23 index22 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">port\u00a0:\u00a080,<\/code><\/div>\n<div class=\"line number24 index23 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">method\u00a0:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'POST'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number25 index24 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">path\u00a0:\u00a0<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'\/upload'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><\/div>\n<div class=\"line number26 index25 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">handers:{}<\/code><\/div>\n<div class=\"line number27 index26 alt2\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">};<\/code><\/div>\n<div class=\"line number28 index27 alt1\"><\/div>\n<div class=\"line number29 index28 alt2\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/**<\/code><\/div>\n<div class=\"line number30 index29 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u5982\u4e0b\u7279\u522b\u7684\u6d88\u606f\u5934\u5e94\u5f53\u6ce8\u610f\uff1a<\/code><\/div>\n<div class=\"line number31 index30 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u53d1\u9001'Connection:\u00a0keep-alive'\u5934\u90e8\u5c06\u901a\u77e5Node\u6b64\u8fde\u63a5\u5c06\u4fdd\u6301\u5230\u4e0b\u4e00\u6b21\u8bf7\u6c42\u3002<\/code><\/div>\n<div class=\"line number32 index31 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u53d1\u9001'Content-length'\u5934\u5c06\u4f7f\u9ed8\u8ba4\u7684\u5206\u5757\u7f16\u7801\u65e0\u6548\u3002<\/code><\/div>\n<div class=\"line number33 index32 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u53d1\u9001'Expect'\u5934\u90e8\u5c06\u5f15\u8d77\u8bf7\u6c42\u5934\u90e8\u7acb\u5373\u88ab\u53d1\u9001\u3002<\/code><\/div>\n<div class=\"line number34 index33 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u901a\u5e38\u60c5\u51b5\uff0c\u5f53\u53d1\u9001'Expect:\u00a0100-continue'\u65f6\uff0c\u4f60\u9700\u8981\u76d1\u542ccontinue\u4e8b\u4ef6\u7684\u540c\u65f6\u8bbe\u7f6e\u8d85\u65f6\u3002\u53c2\u89c1RFC2616\u00a08.2.3\u7ae0\u8282\u4ee5\u83b7\u5f97\u66f4\u591a\u7684\u4fe1\u606f\u3002<\/code><\/div>\n<div class=\"line number35 index34 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\/<\/code><\/div>\n<div class=\"line number36 index35 alt1\"><\/div>\n<div class=\"line number37 index36 alt2\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/**<\/code><\/div>\n<div class=\"line number38 index37 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u8bf4\u660e\uff1a\u5b98\u65b9\u7ed9\u51fa\u7684\u4f8b\u5b50<\/code><\/div>\n<div class=\"line number39 index38 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u5e94\u7528\u573a\u666f\uff1a\u6a21\u62df\u5ba2\u670d\u7aef\u8bf7\u6c42\u670d\u52a1\u5668\uff0c\u662f\u4e00\u4e2aHTTP\u00a0\u5ba2\u6237\u7aef\u5de5\u5177\uff0c\u7528\u4e8e\u5411\u00a0HTTP\u00a0\u670d\u52a1\u5668\u53d1\u8d77\u8bf7\u6c42\u3002<\/code><\/div>\n<div class=\"line number40 index39 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{Object}\u00a0options<\/code><\/div>\n<div class=\"line number41 index40 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{Function}\u00a0callback<\/code><\/div>\n<div class=\"line number42 index41 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\/<\/code><\/div>\n<div class=\"line number43 index42 alt2\"><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">var<\/code>\u00a0<code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">req\u00a0=\u00a0http.request(options,<\/code><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">function<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">(res){<\/code><\/div>\n<div class=\"line number44 index43 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">console.log(res);<\/code><\/div>\n<div class=\"line number45 index44 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">console.log(<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'STATUS:'<\/code>\u00a0<code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">+\u00a0res.statusCode);<\/code><\/div>\n<div class=\"line number46 index45 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">console.log(<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'HEADERS:'<\/code>\u00a0<code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">+\u00a0JSON.stringify(res.headers));<\/code><\/div>\n<div class=\"line number47 index46 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">res.setEncoding(<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'utf8'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">);<\/code><\/div>\n<div class=\"line number48 index47 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">res.on(<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'data'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">function<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">(chunk){<\/code><\/div>\n<div class=\"line number49 index48 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">console.log(<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'BODY'<\/code>\u00a0<code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">+\u00a0chunk);<\/code><\/div>\n<div class=\"line number50 index49 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">});<\/code><\/div>\n<div class=\"line number51 index50 alt2\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">});<\/code><\/div>\n<div class=\"line number52 index51 alt1\"><\/div>\n<div class=\"line number53 index52 alt2\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">req.on(<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'response'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">function<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">(){<\/code><\/div>\n<div class=\"line number54 index53 alt1\"><\/div>\n<div class=\"line number55 index54 alt2\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">});<\/code><\/div>\n<div class=\"line number56 index55 alt1\"><\/div>\n<div class=\"line number57 index56 alt2\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">req.on(<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'connect'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">function<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">(){<\/code><\/div>\n<div class=\"line number58 index57 alt1\"><\/div>\n<div class=\"line number59 index58 alt2\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">});<\/code><\/div>\n<div class=\"line number60 index59 alt1\"><\/div>\n<div class=\"line number61 index60 alt2\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">req.on(<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'socket'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">function<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">(){<\/code><\/div>\n<div class=\"line number62 index61 alt1\"><\/div>\n<div class=\"line number63 index62 alt2\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">});<\/code><\/div>\n<div class=\"line number64 index63 alt1\"><\/div>\n<div class=\"line number65 index64 alt2\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">req.on(<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'upgrade'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">function<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">(){<\/code><\/div>\n<div class=\"line number66 index65 alt1\"><\/div>\n<div class=\"line number67 index66 alt2\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">});<\/code><\/div>\n<div class=\"line number68 index67 alt1\"><\/div>\n<div class=\"line number69 index68 alt2\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">req.on(<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'continue'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">function<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">(){<\/code><\/div>\n<div class=\"line number70 index69 alt1\"><\/div>\n<div class=\"line number71 index70 alt2\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">})<\/code><\/div>\n<div class=\"line number72 index71 alt1\"><\/div>\n<div class=\"line number73 index72 alt2\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/\/\u5982\u679c\u5728\u8bf7\u6c42\u8fc7\u7a0b\u4e2d\u51fa\u73b0\u4e86\u9519\u8bef\uff08\u53ef\u80fd\u662fDNS\u89e3\u6790\u3001TCP\u7684\u9519\u8bef\u3001\u6216\u8005HTTP\u89e3\u6790\u9519\u8bef\uff09\uff0c\u8fd4\u56de\u7684\u8bf7\u6c42\u5bf9\u8c61\u4e0a\u7684'error'\u7684\u4e8b\u4ef6\u5c06\u88ab\u89e6\u53d1\u3002<\/code><\/div>\n<div class=\"line number74 index73 alt1\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">req.on(<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'error'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">function<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">(e){<\/code><\/div>\n<div class=\"line number75 index74 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">console.log(e.message);<\/code><\/div>\n<div class=\"line number76 index75 alt1\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">});<\/code><\/div>\n<div class=\"line number77 index76 alt2\"><\/div>\n<div class=\"line number78 index77 alt1\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/**<\/code><\/div>\n<div class=\"line number79 index78 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u6e90API\uff1arequest.write(chunk,\u00a0[encoding])<\/code><\/div>\n<div class=\"line number80 index79 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u8bf4\u660e\uff1a\u53d1\u9001\u6b63\u6587\u4e2d\u7684\u4e00\u5757\u3002\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u591a\u6b21\u8c03\u7528\u8fd9\u4e2a\u65b9\u6cd5\u5c06\u8bf7\u6c42\u6b63\u6587\u4ee5\u6d41\u7684\u65b9\u5f0f\u53d1\u9001\u5230\u670d\u52a1\u5668\u3002\u6b64\u79cd\u60c5\u51b5\u5efa\u8bae\u5728\u5efa\u7acb\u8bf7\u6c42\u65f6\u4f7f\u7528['Transfer-Encoding',\u00a0'chunked']\u8bf7\u6c42\u5934\u3002<\/code><\/div>\n<div class=\"line number81 index80 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{Object\u00a0or\u00a0String}\u00a0chunk\u00a0\u53c2\u6570chunk\u5e94\u5f53\u662f\u4e00\u4e2a\u6574\u6570\u6570\u7ec4\u6216\u5b57\u7b26\u4e32\u3002<\/code><\/div>\n<div class=\"line number82 index81 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{String}\u00a0encoding\u00a0\u53c2\u6570encoding\u662f\u53ef\u9009\u7684\uff0c\u4ec5\u5728chunk\u4e3a\u5b57\u7b26\u4e32\u65f6\u53ef\u7528\u3002<\/code><\/div>\n<div class=\"line number83 index82 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\/<\/code><\/div>\n<div class=\"line number84 index83 alt1\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">req.write(<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'data\\n'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">);<\/code><\/div>\n<div class=\"line number85 index84 alt2\"><\/div>\n<div class=\"line number86 index85 alt1\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/**<\/code><\/div>\n<div class=\"line number87 index86 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u6e90API\uff1arequest.end(chunk,\u00a0[encoding])<\/code><\/div>\n<div class=\"line number88 index87 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u8bf4\u660e\uff1a\u5b8c\u6210\u672c\u6b21\u8bf7\u6c42\u7684\u53d1\u9001\u3002\u5982\u679c\u6b63\u6587\u4e2d\u7684\u4efb\u4f55\u4e00\u4e2a\u90e8\u5206\u6ca1\u6709\u6765\u5f97\u53ca\u53d1\u9001\uff0c\u5c06\u628a\u4ed6\u4eec\u5168\u90e8\u5237\u65b0\u5230\u6d41\u4e2d\u3002\u5982\u679c\u672c\u6b21\u8bf7\u6c42\u662f\u5206\u5757\u7684\uff0c\u8fd9\u4e2a\u51fd\u6570\u5c06\u53d1\u51fa\u7ed3\u675f\u5b57\u7b26'0\\r\\n\\r\\n'\u3002\u5982\u679c\u4f7f\u7528\u53c2\u6570data\uff0c\u5c31\u7b49\u4e8e\u5728\u8c03\u7528request.write(data,\u00a0encoding)\u4e4b\u540e\u7d27\u63a5\u7740\u8c03\u7528request.end()\u3002<\/code><\/div>\n<div class=\"line number89 index88 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{Object\u00a0or\u00a0String}\u00a0chunk\u00a0\u53c2\u6570chunk\u5e94\u5f53\u662f\u4e00\u4e2a\u6574\u6570\u6570\u7ec4\u6216\u5b57\u7b26\u4e32\u3002<\/code><\/div>\n<div class=\"line number90 index89 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{String}\u00a0encoding\u00a0\u53c2\u6570encoding\u662f\u53ef\u9009\u7684\uff0c\u4ec5\u5728chunk\u4e3a\u5b57\u7b26\u4e32\u65f6\u53ef\u7528\u3002<\/code><\/div>\n<div class=\"line number91 index90 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0example:\u00a0req.end(),req.end('data\\n'),req.end('data','utf8'),req.end(chunk)<\/code><\/div>\n<div class=\"line number92 index91 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\/<\/code><\/div>\n<div class=\"line number93 index92 alt2\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">req.end();<\/code><\/div>\n<div class=\"line number94 index93 alt1\"><\/div>\n<div class=\"line number95 index94 alt2\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/**<\/code><\/div>\n<div class=\"line number96 index95 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u963b\u6b62\u4e00\u4e2a\u8bf7\u6c42\u3002\uff08v0.3.8\u4e2d\u65b0\u589e\u7684\u65b9\u6cd5\u3002\uff09<\/code><\/div>\n<div class=\"line number97 index96 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\/<\/code><\/div>\n<div class=\"line number98 index97 alt1\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">req.abort();<\/code><\/div>\n<div class=\"line number99 index98 alt2\"><\/div>\n<div class=\"line number100 index99 alt1\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/**<\/code><\/div>\n<div class=\"line number101 index100 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u6e90API\uff1arequest.setTimeout(timeout,\u00a0[callback])<\/code><\/div>\n<div class=\"line number102 index101 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u8bf4\u660e\uff1a\u4e00\u65e6\u7ed9\u8fd9\u4e2a\u8bf7\u6c42\u5206\u914d\u7684\u662f\u4e00\u4e2asocket\u65f6\u6b64\u51fd\u6570\u4f1a\u88ab\u8c03\u7528<\/code><\/div>\n<div class=\"line number103 index102 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{Number}\u00a0timeout\u00a0\u6beb\u79d2<\/code><\/div>\n<div class=\"line number104 index103 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{Function}\u00a0callback\u00a0\u56de\u5230\u51fd\u6570<\/code><\/div>\n<div class=\"line number105 index104 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\/<\/code><\/div>\n<div class=\"line number106 index105 alt1\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">req.setTimeout(1000,<\/code><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">function<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">(){});<\/code><\/div>\n<div class=\"line number107 index106 alt2\"><\/div>\n<div class=\"line number108 index107 alt1\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/**<\/code><\/div>\n<div class=\"line number109 index108 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u6e90API\u00a0:request.setNoDelay([noDelay])<\/code><\/div>\n<div class=\"line number110 index109 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u8bf4\u660e\uff1a\u9ed8\u8ba4\u6709\u4e00\u5b9a\u7684\u5ef6\u8fdf\uff0c\u8bbe\u7f6e\u4e3a0\u8868\u793a\u65e0\u5ef6\u8fdf<\/code><\/div>\n<div class=\"line number111 index110 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{Number}\u00a0noDelay<\/code><\/div>\n<div class=\"line number112 index111 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\/<\/code><\/div>\n<div class=\"line number113 index112 alt2\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">req.setNoDelay(0)<\/code><\/div>\n<div class=\"line number114 index113 alt1\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/**<\/code><\/div>\n<div class=\"line number115 index114 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u6e90API\uff1arequest.setSocketKeepAlive([enable],\u00a0[initialDelay])<\/code><\/div>\n<div class=\"line number116 index115 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u00a0\u00a0\u00a0\u00a0\u7c7b\u4f3c\u540c\u4e0a<\/code><\/div>\n<div class=\"line number117 index116 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\/<\/code><\/div>\n<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3 style=\"font-weight: 600;\"><strong>\u56db\u3001http.get<\/strong><\/h3>\n<p>http.get(options, callback) http \u6a21\u5757\u8fd8\u63d0\u4f9b\u4e86\u4e00\u4e2a\u66f4\u52a0\u7b80\u4fbf\u7684\u65b9\u6cd5\u7528\u4e8e\u5904\u7406GET\u8bf7\u6c42\uff1ahttp.get\u3002\u5b83\u662f http.request \u7684\u7b80\u5316\u7248\uff0c\u552f\u4e00\u7684\u533a\u522b\u5728\u4e8ehttp.get\u81ea\u52a8\u5c06\u8bf7\u6c42\u65b9\u6cd5\u8bbe\u4e3a\u4e86 GET \u8bf7\u6c42\uff0c\u540c\u65f6\u4e0d\u9700\u8981\u624b\u52a8\u8c03\u7528 req.end()\u3002<\/p>\n<div>\n<div id=\"highlighter_378969\" class=\"syntaxhighlighter  js\">\n<div class=\"toolbar\" style=\"font-weight: normal !important; font-style: normal !important; color: white !important;\"><a class=\"toolbar_item command_help help\" style=\"font-weight: normal !important; font-style: normal !important; color: white !important;\" href=\"http:\/\/my.oschina.net\/antianlu\/blog\/228511#\">?<\/a><\/div>\n<div class=\"line number1 index0 alt2\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/**<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0Created\u00a0by\u00a0Administrator\u00a0on\u00a014-4-30.<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\/<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">var<\/code>\u00a0<code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">http\u00a0=\u00a0require(<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'http'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">);<\/code><\/div>\n<div class=\"line number6 index5 alt1\"><\/div>\n<div class=\"line number7 index6 alt2\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">http.createServer(<\/code><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">function<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">(req,res){<\/code><\/div>\n<div class=\"line number8 index7 alt1\"><\/div>\n<div class=\"line number9 index8 alt2\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">}).listen(3000);<\/code><\/div>\n<div class=\"line number10 index9 alt1\"><\/div>\n<div class=\"line number11 index10 alt2\"><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">\/**<\/code><\/div>\n<div class=\"line number12 index11 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u8bf4\u660e\uff1a\u7531\u4e8e\u5927\u90e8\u5206\u8bf7\u6c42\u662f\u4e0d\u5305\u542b\u6b63\u6587\u7684GET\u8bf7\u6c42\uff0cNode\u63d0\u4f9b\u4e86\u8fd9\u4e2a\u65b9\u4fbf\u7684\u65b9\u6cd5\u3002\u4e0ehttp.request()\u552f\u4e00\u7684\u533a\u522b\u662f\u6b64\u65b9\u6cd5\u5c06\u8bf7\u6c42\u65b9\u5f0f\u8bbe\u7f6e\u4e3aGET\uff0c\u5e76\u4e14\u81ea\u52a8\u8c03\u7528req.end()\u3002<\/code><\/div>\n<div class=\"line number13 index12 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0\u5e94\u7528\uff1a\u670d\u52a1\u5668\u7aef\u6d4b\u8bd5\u5ba2\u670d\u7aef\u8bf7\u6c42\u8c03\u8bd5\u7b49<\/code><\/div>\n<div class=\"line number14 index13 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{String}\u00a0url\u00a0\u6709\u6548\u5730\u5740<\/code><\/div>\n<div class=\"line number15 index14 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\u00a0@param\u00a0{Function}\u00a0callback<\/code><\/div>\n<div class=\"line number16 index15 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0<\/code><code class=\"js comments\" style=\"font-weight: normal !important; font-style: normal !important; color: #008200 !important;\">*\/<\/code><\/div>\n<div class=\"line number17 index16 alt2\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">http.get(<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'http:\/\/www.baidu.com\/index.html'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">function<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">(res){<\/code><\/div>\n<div class=\"line number18 index17 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">console.log(<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'get\u00a0response\u00a0Code\u00a0:'<\/code>\u00a0<code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">+\u00a0res.statusCode);<\/code><\/div>\n<div class=\"line number19 index18 alt2\"><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">}).on(<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">'error'<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">,<\/code><code class=\"js keyword\" style=\"font-weight: bold !important; font-style: normal !important; color: #006699 !important;\">function<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">(e){<\/code><\/div>\n<div class=\"line number20 index19 alt1\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">console.log(<\/code><code class=\"js string\" style=\"font-weight: normal !important; font-style: normal !important; color: blue !important;\">\"Got\u00a0error:\u00a0\"<\/code>\u00a0<code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">+\u00a0e.message);<\/code><\/div>\n<div class=\"line number21 index20 alt2\"><code class=\"js spaces\" style=\"font-weight: normal !important; font-style: normal !important; color: red;\">\u00a0\u00a0\u00a0\u00a0<\/code><code class=\"js plain\" style=\"font-weight: normal !important; font-style: normal !important; color: black !important;\">})<\/code><\/div>\n<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/my.oschina.net\/antianlu\/blog\/228511\" target=\"_blank\">\u00a0http:\/\/my.oschina.net\/antianlu\/blog\/228511<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u76f4\u63a5\u901a\u8fc7http\u5bf9\u8c61\u4f7f\u7528\u7684\u6709\uff1a \u4e00\u3001http.STATUS_CODES \u4e8c\u3001http.createServer [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35],"tags":[],"class_list":["post-4710","post","type-post","status-publish","format-standard","hentry","category-nodejs"],"_links":{"self":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts\/4710","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4710"}],"version-history":[{"count":0,"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts\/4710\/revisions"}],"wp:attachment":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4710"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4710"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4710"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}