Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Executing curl from Javascript?

Tags:

Is there a way to execute curl from Javascript? Thanks.

like image 308
nate Avatar asked May 10 '10 16:05

nate


People also ask

Can you run curl in JavaScript?

To perform a curl request in JavaScript, we can use the fetch function. We call fetch with the URL we want to make the request to to make a GET request. Then we call res. json to convert the response body object to JSON.

What is curl command in NodeJS?

Curl is a way you can hit a URL from your code to get an HTML response from it. In NodeJS/ExpressJS we use “request” module for this purpose. In Simple Words, if we want to access HTML content of any site we pass that URL to request( ) and it returns the HTML source code.


2 Answers

Nope. You'll need to look at using Ajax/XMLHttpRequest instead. http://en.wikipedia.org/wiki/Ajax_%28programming%29

like image 94
Timothy Avatar answered Sep 30 '22 05:09

Timothy


It depends on what curl you are talking about. You are probably asking about cURL, but if you are asking about the Curl programming language, then the answer is yes. You can invoke Curl methods on an object in an embedded Curl subapplet using the applet_invoke method. There are examples of this in the subapplet examples that are included in the Curl Developer's Guide.

like image 29
Christopher Barber Avatar answered Sep 30 '22 06:09

Christopher Barber