本文介绍了在 Node.js 中等效的 cURL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望使用来自使用 Node.js 的 HTTP 请求的信息(即调用远程 Web 服务并将响应回显给客户端).
I'm looking to use information from an HTTP request using Node.js (i.e. call a remote web service and echo the response to the client).
在 PHP 中,我会使用 cURL 来做到这一点.Node 中的最佳实践是什么?
In PHP I would have used cURL to do this. What is the best practice in Node?
推荐答案
查看 HTTP 模块的文档以获得完整示例:
See the documentation for the HTTP module for a full example:
https://nodejs.org/api/http.html#http_http_request_options_callback
这篇关于在 Node.js 中等效的 cURL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!