@@ -19,7 +19,7 @@ World":
1919var sys = require("sys"),
2020 http = require("http");
2121http.createServer(function (request, response) {
22- response.writeHeader (200, {"Content-Type": "text/plain"});
22+ response.writeHead (200, {"Content-Type": "text/plain"});
2323 response.write("Hello World\n");
2424 response.close();
2525}).listen(8000);
@@ -951,7 +951,7 @@ The +http.Connection+ object.
951951This object is created internally by a HTTP server--not by the user. It is
952952passed as the second parameter to the +"request"+ event.
953953
954- +response.writeHeader (statusCode[, reasonPhrase] , headers)+ ::
954+ +response.writeHead (statusCode[, reasonPhrase] , headers)+ ::
955955
956956Sends a response header to the request. The status code is a 3-digit HTTP
957957status code, like +404+. The last argument, +headers+, are the response headers.
@@ -962,7 +962,7 @@ Example:
962962+
963963----------------------------------------
964964var body = "hello world";
965- response.writeHeader (200, {
965+ response.writeHead (200, {
966966 "Content-Length": body.length,
967967 "Content-Type": "text/plain"
968968});
@@ -973,7 +973,7 @@ be called before +response.close()+ is called.
973973
974974+response.write(chunk, encoding="ascii")+ ::
975975
976- This method must be called after +writeHeader + was
976+ This method must be called after +writeHead + was
977977called. It sends a chunk of the response body. This method may
978978be called multiple times to provide successive parts of the body.
979979+
@@ -1297,7 +1297,7 @@ http.createServer(function (req, res) {
12971297 fields = {},
12981298 name, filename;
12991299 mp.addListener("error", function (er) {
1300- res.writeHeader (400, {"content-type":"text/plain"});
1300+ res.writeHead (400, {"content-type":"text/plain"});
13011301 res.write("You sent a bad message!\n"+er.message);
13021302 res.close();
13031303 });
@@ -1317,7 +1317,7 @@ http.createServer(function (req, res) {
13171317 });
13181318 mp.addListener("complete", function () {
13191319 var response = "You posted: \n" + sys.inspect(fields);
1320- res.writeHeader (200, {
1320+ res.writeHead (200, {
13211321 "content-type" : "text/plain",
13221322 "content-length" : response.length
13231323 });
0 commit comments