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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-05-16 16:27:092063browse

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.');
Statement:
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