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
69
votes
1 answer

How to convert cURL to postman?

Postman has built-in function to convert postman to cURL code, but if I want to convert cURL code to postman, How can I do this efficiently? For example, cURL code as following; curl -v -X POST…
James Chang
  • 821
  • 1
  • 6
  • 5
69
votes
2 answers

CURL escape single quote

How can I make this work? curl -XPOST 'http://localhost:9290/location/place' -d '{"geoloc": {"lat": "38.1899", "lon": "-76.5087"}, "longitude": "-76.5087", "admin_name1": "Maryland", "admin_name2": "St. Mary's", "admin_name3": "", "postal_code":…
mikeb
  • 10,578
  • 7
  • 62
  • 120
68
votes
2 answers

Why Doesn't Fiddler Show Curl Traffic?

Why doesn't Fiddler show curl traffic? Other traffic gets displayed, just not curl. How can I get fiddler to intercept curl traffic?
BSalita
  • 8,420
  • 10
  • 51
  • 68
68
votes
22 answers

Getting title and meta tags from external website

I want to try figure out how to get the A common title Even though if it's arranged in any order, I've heard of the PHP…
MacMac
  • 34,294
  • 55
  • 151
  • 222
68
votes
6 answers

Adding subscribers to a list using Mailchimp's API v3

I'm trying to add users to a list I've created in Mailchimp but I can't find any code examples anywhere. I've tried figuring out how to use the API but I'm very much a "Look at an example and learn" kind of person. I've tried using version 2 of the…
VenomRush
  • 1,622
  • 3
  • 15
  • 25
68
votes
5 answers

POST with curl without sending data

Is there a way to use curl to send a POST request without sending any data? We usually post like: curl --data @C:\mydata.txt http://1.2.3.4/myapi If you omit the --data you are doing a GET. How can you omit it and still do a POST?
Marcus Leon
  • 55,199
  • 118
  • 297
  • 429
67
votes
7 answers

How to enable curl in xampp?

How to enable curl in xampp ? My PHP twitter application needs curl function. But it is not enabled in XAMPP. how to enable it. I found no options for doing that.
Aakash Chakravarthy
  • 10,523
  • 18
  • 61
  • 78
66
votes
5 answers

curl: read headers from file

After the --dump-header writes a file, how to read those headers back into the next request? I would like to read them from a file because there are a number of them. I tried standard in: cat headers | curl -v -H - ... I'm actually using the…
jcalfee314
  • 4,642
  • 8
  • 43
  • 75
65
votes
4 answers

Persistent/keepalive HTTP with the PHP Curl library?

I'm using a simple PHP library to add documents to a SOLR index, via HTTP. There are 3 servers involved, currently: The PHP box running the indexing job A database box holding the data being indexed The solr box. At 80 documents/sec (out of 1…
Frank Farmer
  • 38,246
  • 12
  • 71
  • 89
65
votes
2 answers

curl - Is data encrypted when using the --insecure option?

I have a situation where the client makes a call through curl to a https url. The SSL certificate of the https url is self signed and therefore curl cannot do certificate validation and fails. curl provides an option -k/--insecure which disables…
randomuser
  • 1,858
  • 2
  • 17
  • 21
65
votes
4 answers

cURL with a PKCS#12 certificate in a bash script

i have to connect to a webservice, where a pkcs12 certificate is a must. the idea was to use curl in a bash script (under OS X, to be specific). i have learnt that one of the few things curl cannot do in communication, is handling pkcs12…
svenson
  • 805
  • 1
  • 10
  • 12
65
votes
12 answers

Can't connect to HTTPS site using cURL. Returns 0 length content instead. What can I do?

I have a site that connects using cURL (latest version) to a secure gateway for payment. The problem is cURL always returns 0 length content. I get headers only. And only when I set cURL to return headers. I have the following flags in…
alex
  • 479,566
  • 201
  • 878
  • 984
65
votes
5 answers

Curl and PHP - how can I pass a json through curl by PUT,POST,GET

I have been working on building an Rest API for the hell of it and I have been testing it out as I go along by using curl from the command line which is very easy for CRUD I can successfully make these call from the command line curl -u…
Gilberg
  • 2,514
  • 4
  • 31
  • 41
64
votes
3 answers

Display all content with Invoke-WebRequest

So I decided to start using PowerShell rather than Command Prompt. And I want to run curl. Very different output then discover that curl is an alias to Invoke-WebRequest in PowerShell. Using PowerShell curl in the same way as real curl, I only get…
John
  • 1,593
  • 3
  • 17
  • 28
64
votes
9 answers

Abuse cURL to communicate with Redis

I want to send a PING to Redis to check if the connection is working, now I could just install redis-cli, but I don't want to and curl is already there. So how can I abuse curl to do that? Basically I need to turn off what's send here: > GET /…
Mahoni
  • 7,088
  • 17
  • 58
  • 115