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
64
votes
4 answers

undefined reference to curl_global_init, curl_easy_init and other function(C)

I am trying to use Curl in C. I visited Curl official page, and copied sample source code. below is the link: http://curl.haxx.se/libcurl/c/sepheaders.html when I run this code with command "gcc test.c", the console shows message like…
Juneyoung Oh
  • 7,318
  • 16
  • 73
  • 121
64
votes
6 answers

Header only retrieval in php via curl

Actually I have two questions. (1) Is there any reduction in processing power or bandwidth used on remote server if I retrieve only headers as opposed to full page retrieval using php and curl? (2) Since I think, and I might be wrong, that answer to…
Krule
  • 6,468
  • 3
  • 34
  • 56
64
votes
6 answers

How to use curl with Django, csrf tokens and POST requests

I'm using curl to test one of my Django forms. The calls I've tried (with errors from each, and over multiple lines for readability): (1): curl -d "{\"email\":\"test@test.com\"}" --header "X-CSRFToken: [triple checked value from the source code of a…
Trindaz
  • 17,029
  • 21
  • 82
  • 111
63
votes
8 answers

How to check if a file exists from a url

I need to check if a particular file exists on a remote server. Using is_file() and file_exists() doesn't work. Any ideas how to do this quickly and easily?
David
  • 16,246
  • 34
  • 103
  • 162
63
votes
5 answers

Login to remote site with PHP cURL

I'm new to using cURL and its hard to find good resources for it. What I'm trying to do is login to a remote site, by having curl do the login form and then send back that it was successful. The code I have doesn't seem to work and only tries to…
Panama Jack
  • 24,158
  • 10
  • 63
  • 95
63
votes
1 answer

NodeJS HttpGet to a URL with JSON response

I'm trying to make a server-side API call using a RESTful protocol with a JSON response. I've read up on both the API documentation and this SO post. The API that I'm trying to pull from tracks busses and returns data in a JSON output. I'm confused…
CaliCoder
  • 663
  • 2
  • 6
  • 6
62
votes
4 answers

curl: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate

C:\Users\casta>curl https://c5.ppy.sh curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate. I've made my own CA, and I made a certificate…
LPOPYui
  • 799
  • 1
  • 9
  • 17
62
votes
6 answers

Boost.ASIO-based HTTP client library (like libcurl)

I am looking for a modern C++ HTTP library because libcurl's shortcomings are difficult to work around by C++ wrappers. Solutions based on Boost.ASIO, which has become the de-facto C++ TCP library, are preferred.
Tronic
  • 10,250
  • 2
  • 41
  • 53
62
votes
5 answers

Having trouble escaping quotes and braces

I am trying to execute the following line in Command Prompt: curl -X POST -d '{ "method" : "account_info", "params" : [ { "account" : "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh"} ] }' http://s1.ripple.com:51234 However, I get the following: curl: (6)…
killajoule
  • 3,612
  • 7
  • 30
  • 36
62
votes
10 answers

Check whether image exists on remote URL

I am generating dynamic URLs of images for book ISBNs. I need a reliable way with PHP to check whether the images actually exist at the remote url. I tried various approaches with different PHP libraries, curl, etc., but none of them works well,…
Cristian Cotovan
  • 1,090
  • 1
  • 13
  • 23
61
votes
3 answers

how to use cURL on specific interface

I am developing a code in c, which simply FTPs the files on FTP server by using curl utility, by following this example now i have one simple thing to do, specify curl to use particular interface (IP) of the server for upload, as other interface of…
madiha malik
  • 827
  • 2
  • 8
  • 15
61
votes
4 answers

How to use basic authorization in PHP curl

I am having problem with PHP curl request with basic authorization. Here is the command line curl: curl -H "Accept: application/product+xml" "https://{id}:{api_key}@api.domain.com/products?limit=1&offset=0" I have tried by setting curl header in…
Al Amin
  • 631
  • 1
  • 5
  • 9
60
votes
2 answers

How to check the validity of a remote git repository URL?

Within a bash script, what would be the simplest way to verify that a git URL points to a valid git repo and that the script has access to read from it? Protocols that should be supported are git@, https://, and git://. Curl fails on the git://…
Highway of Life
  • 22,803
  • 16
  • 52
  • 80
60
votes
13 answers

Sending Push via Postman using Firebase Messaging

I'm trying to use Postman to send a single Push Notification using Firebase Cloud Messaging service. This is a working cURL command for the same purposal, on which I'm using as a reference. curl -X POST --header "Authorization: key="…
Machado
  • 14,105
  • 13
  • 56
  • 97
60
votes
3 answers

How to parse JSON and access results

I am using CURL to send a request. The response dataType is json. How can I parse this data and insert it into the database?
wahid
  • 1,150
  • 1
  • 9
  • 16