Home > Web Front-end > JS Tutorial > Instructions for using the http.createClient method in node.js_node.js

Instructions for using the http.createClient method in node.js_node.js

WBOY
Release: 2016-05-16 16:27:09
Original
2010 people have browsed it

Method description:

This function is obsolete, new versions use [http.request()][] to replace it.

A new HTTP client has been built.

Grammar:

Copy code The code is as follows:

http.createClient([port], [host])

Since this method belongs to the http module, the http module needs to be introduced before use (var http= require("http") )

Receive parameters:

post Port

host Host

Source code:

Copy code The code is as follows:

exports.createClient = util.deprecate(function(port, host) {
Return new Client(port, host);
}, 'http.createClient is deprecated. Use `http.request` instead.');
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template