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
585
votes
15 answers

How can I see the request headers made by curl when sending a request to the server?

I want to see the request headers made by curl when I am sending a request to the server. How can I check that?
leela
584
votes
18 answers

performing HTTP requests with cURL (using PROXY)

I have this proxy address: 125.119.175.48:8909 How can I perform a HTTP request using cURL like curl http://www.example.com, but specifying the proxy address of my network?
user873286
  • 7,799
  • 7
  • 30
  • 38
583
votes
47 answers

wget/curl large file from google drive

I'm trying to download a file from google drive in a script, and I'm having a little trouble doing so. The files I'm trying to download are here. I've looked online extensively and I finally managed to get one of them to download. I got the UIDs of…
Arjun
  • 5,978
  • 3
  • 12
  • 10
581
votes
14 answers

How to set the authorization header using cURL

How do I pass authorization header using cURL? ( executable in /usr/bin/curl).
Vidya
  • 7,717
  • 12
  • 48
  • 75
550
votes
11 answers

Using cURL to upload POST data with files

I would like to use cURL to not only send data parameters in HTTP POST but to also upload files with specific form name. How should I go about doing that ? HTTP Post parameters: userid = 12345 filecomment = This is an image file HTTP File…
thotheolh
  • 7,040
  • 7
  • 33
  • 49
539
votes
5 answers

How to do a PUT request with cURL?

How do I test a RESTful PUT (or DELETE) method using cURL?
John
  • 13,125
  • 14
  • 52
  • 73
515
votes
37 answers

How to urlencode data for curl command?

I am trying to write a bash script for testing that takes a parameter and sends it through curl to web site. I need to url encode the value to make sure that special characters are processed properly. What is the best way to do this? Here is my…
Aaron
  • 19,151
  • 4
  • 28
  • 23
479
votes
37 answers

curl: (60) SSL certificate problem: unable to get local issuer certificate

root@sclrdev:/home/sclr/certs/FreshCerts# curl --ftp-ssl --verbose ftp://{abc}/ -u trup:trup --cacert /etc/ssl/certs/ca-certificates.crt * About to connect() to {abc} port 21 (#0) * Trying {abc}... * Connected to {abc} ({abc}) port 21 (#0) <…
user3812540
  • 4,815
  • 3
  • 12
  • 4
479
votes
5 answers

How can I connect to a Tor hidden service using cURL in PHP?

I'm trying to connect to a Tor hidden service using the following PHP code: $url = 'http://jhiwjjlqpyawmpjx.onion/' $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch,…
frosty
  • 4,741
  • 4
  • 17
  • 9
468
votes
4 answers

PHP cURL custom headers

I'm wondering if/how you can add custom headers to a cURL HTTP request in PHP. I'm trying to emulate how iTunes grabs artwork and it uses these non-standard headers: X-Apple-Tz: 0 X-Apple-Store-Front: 143444,12 How could I add these headers to a…
123
  • 5,666
  • 7
  • 25
  • 30
445
votes
2 answers

Call to undefined function curl_init()?

When i am going to implement Authorize.net payment gateway. However, I got this error: Call to undefined function curl_init() Please let me know what is wrong in it.
Pramod Kumar Sharma
  • 7,851
  • 5
  • 28
  • 53
442
votes
23 answers

Run cURL commands from Windows console

Is there a way to install cURL in Windows in order to run cURL commands from the command prompt?
DomingoSL
  • 14,920
  • 24
  • 99
  • 173
429
votes
5 answers

How can you debug a CORS request with cURL?

How can you debug CORS requests using cURL? So far I couldn't find a way to "simulate" the preflight request.
themihai
  • 7,903
  • 11
  • 39
  • 61
419
votes
10 answers

How to use cURL to send Cookies?

I read that sending cookies with cURL works, but not for me. I have a REST endpoint like this: class LoginResource(restful.Resource): def get(self): print(session) if 'USER_TOKEN' in session: return 'OK' …
daydreamer
  • 87,243
  • 191
  • 450
  • 722
419
votes
2 answers

HTTP POST and GET using cURL in Linux

I have a server application written in ASP.NET on Windows that provides a web service. How can I call the web service in Linux with cURL?
Randhi Rupesh
  • 14,650
  • 9
  • 27
  • 46