Questions tagged [curl]

cURL is a library and command-line tool for transferring data using various protocols such as HTTP, FTP and SFTP. The cURL project produces two products, libcurl and curl. This tag covers all usages of cURL, regardless of which cURL product is used.

The cURL project consists of a command-line tool, curl, and a C library, libcurl, for transferring data using internet protocols such as DICT, FILE, FTP, FTPS, Gopher, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, SSH, Telnet and TFTP

For example, curl can be used to download a web page and save it to a file:

curl -o curltest.html www.example.com

, written in , has bindings for a number of languages. Please use the tag for questions about compiling or integrating cURL into another project (i.e. compiling with cURL support).

is an example of a project that has implemented cURL and its use has become quite popular, due to its versatility.

Common PHP Questions

Resources

43780 questions
59
votes
10 answers

How to remove HTTP headers from CURL response?

I have a php script that returns just plain text without any html. Now I want to make a cURL request to that script and I get the following response: HTTP/1.1 200 OK Date: Mon, 28 Feb 2011 14:21:51 GMT Server: Apache/2.2.14 (Ubuntu) X-Powered-By:…
DarkLeafyGreen
  • 69,338
  • 131
  • 383
  • 601
59
votes
3 answers

Invoke-WebRequest : Cannot bind parameter 'Headers'

I am trying to execute a curl command in powershell: curl --user bitcoinipvision --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "move", "params": ["acc-1", "acc-2", 6, 5, "happy birthday!"] }' -H 'content-type: application/json;'…
Zenith
  • 1,037
  • 1
  • 10
  • 21
59
votes
2 answers

How can I emulate a get request exactly like a web browser?

There are websites that when I open specific ajax request on browser, I get the resulted page. But when I try to load them with curl, I receive an error from the server. How can I properly emulate a get request to the server that will simulate a…
ufk
  • 30,912
  • 70
  • 235
  • 386
59
votes
13 answers

How do I install cURL on Windows?

I have followed all the instructions here: http://www.tonyspencer.com/2003/10/22/curl-with-php-and-apache-on-windows/ to install & config apache get the PHP5 packages and get the CURL packages. I run the apache and run a PHP script. no problem. but…
murvinlai
  • 48,919
  • 52
  • 129
  • 177
59
votes
2 answers

cURL GET Request Returns No Output

I'm sending a simple curl request to pinterest.com. When I do it using PHP no result is shown. I tried it from command line and no result showed up. Then I tried the verbose mode in curl and it gives: curl 7.27.0 (i686-pc-linux-gnu) libcurl/7.27.0…
S. A. Malik
  • 3,465
  • 6
  • 37
  • 56
58
votes
2 answers

How to use curl to compare the size of the page with deflate enabled and without using it

I have apache with mod_deflate enabled. I would like to find out the size of the page with mod_deflate enabled and without, and compare how much performance is achieved in size. In curl, I seem to ask server for gzipped content using --compressed…
Anjesh
  • 583
  • 1
  • 5
  • 5
58
votes
3 answers

Using jq to fetch key value from json output

I have a file that looks as below: { "repositories": [ { "id": "156c48fc-f208-43e8-a631-4d12deb89fa4", "namespace": "rhel12", "namespaceType": "organization", "name": "rhel6.6", "shortDescription": "", "visibility":…
meallhour
  • 13,921
  • 21
  • 60
  • 117
58
votes
4 answers

Keeping session alive with Curl and PHP

I'm trying to connect to an API, authenticate a user and then view the user details. This is accomplished by first accessing the login endpoint at http://api.example.com/login// to log in and then the following to view user…
John
  • 989
  • 1
  • 7
  • 11
58
votes
8 answers

Can't find libcurl or curl/curl.h (RuntimeError)

I am trying to install curb 0.8.0 on a Windows computer but I can not seem to get anywhere. I have been trying every website 3 pages deep on my Google search. Please, anyone have an idea of how I can get this single thing installed. I have…
MrMortales
  • 647
  • 1
  • 7
  • 7
57
votes
4 answers

Android page Curl animation

Is there a simple way to do the Curl page flipping animation? A Curl animation is animation of pages flipping, including the page above rolling and the shadows over the lower page. What is the recommended way to do a "gallery" that displays two…
Meymann
  • 2,520
  • 2
  • 28
  • 22
57
votes
4 answers

How to download a file into a directory using curl or wget?

I know I can use the following 2 commands to download a file: curl -O example.com/file.zip wget example.com/file.zip But I want them to go into a specific directory. So I can do the following: curl -o mydir/file.zip example.com/file.zip wget -O…
at.
  • 50,922
  • 104
  • 292
  • 461
56
votes
4 answers

How to download a file using curl

I'm on mac OS X and can't figure out how to download a file from a URL via the command line. It's from a static page so I thought copying the download link and then using curl would do the trick but it's not. I referenced this StackOverflow…
Alex Cory
  • 10,635
  • 10
  • 52
  • 62
56
votes
2 answers

Use curl to download a Dropbox folder via shared link (not public link)

Dropbox makes it easy to programmatically download a single file via curl (EX: curl -O https://dl.dropboxusercontent.com/s/file.ext). It is a little bit trickier for a folder (regular directory folder, not zipped). The shared link for a folder, as…
USCFan13
  • 2,001
  • 3
  • 14
  • 11
56
votes
5 answers

Check to see if cURL is installed locally?

How do I check if cURL is installed on my local server instance? Does it matter what type of server I'm running to check it? Is it different if it's a PHP server or a CF server?
chris Frisina
  • 19,086
  • 22
  • 87
  • 167
56
votes
2 answers

DELETE using CURL with encoded URL

I’m trying to make a request using CURL like this: curl -X DELETE "https://myhost/context/path/users/OXYugGKg207g5uN/07V" where OXYugGKg207g5uN/07V is a hash, so I suppose that I need to encode before do this request. I have tried curl -X DELETE…
coffee
  • 3,048
  • 4
  • 32
  • 46