信息发布→ 登录 注册 退出

node.js中的http.createClient方法使用说明

发布时间:2026-01-11

点击量:

方法说明:

此功能已过时,新版本使用 [http.request()][] 来代替它。

构建了一种新的HTTP客户端。

语法:

复制代码 代码如下:
http.createClient([port], [host])

由于该方法属于http模块,使用前需要引入http模块(var http= require(“http”) )

接收参数:

post     端口

host     主机

源码:

复制代码 代码如下:
exports.createClient = util.deprecate(function(port, host) {
  return new Client(port, host);
}, 'http.createClient is deprecated. Use `http.request` instead.');

在线客服
服务热线

服务热线

4008888355

微信咨询
二维码
返回顶部
×二维码

截屏,微信识别二维码

打开微信

微信号已复制,请打开微信添加咨询详情!