Curl: Or the equivalent of - For Server Side Javas

2019-08-28 02:47发布

问题:

Popular scripting languages such as Python and PHP have extensions that utilize the Curl library- but little documentation exists for the newer Javascript server side languges.

I was wondering --is there a library or hack that can mimic the behavior of Curl in server side Javascript frameworks such as NodeJs and PhantomJs?

If no: how can Curl-like requests be made in NodeJs? Or PhantomJs?

Also -and most importantly:

Is there a "pure javascript" implementation that could work in the runtime of any server-side Javascript framework?

回答1:

Node.js has an HTTP client in its core library.

http://nodejs.org/api/http.html