Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var http = require("http");
- http.createServer(function(request, response) {
- response.writeHead(200, {"Content-Type": "text/plain"});
- request.on("data", function(chunk) {
- response.write(chunk.toString().toUpperCase());
- });
- request.on("end", function() {
- response.end();
- });
- }).listen(8000);
- var http = require("http");
- var request = http.request({
- hostname: "localhost",
- port: 8000,
- method: "POST"
- }, function(response) {
- response.on("data", function(chunk) {
- process.stdout.write(chunk.toString());
- });
- });
- request.end("Hello Server");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement