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

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

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

  2020-05-13 我要评论

方法说明:

此功能已过时,新版本使用 [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.');

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们