Questions tagged [curl]

cURL is a CLI tool for issuing HTTP GET, POST, & PUT request.

A formal applications for , cURL was originally developed Daniel Stenberg, and released in 1997. cURL primary function is to transfer data across an array of modern protocols, and has widely been incorporated in programming languages.

Supported Protocols

  • DICT
  • FTP
  • FTPS
  • Gopher
  • HTTP
  • HTTPS
  • IMAP
  • LDAP
  • LDAPS
  • POP3
  • RTSP
  • SCP
  • SFTP
  • SMTP
  • TFTP
  • Telnet
  • URI scheme

Basic usage

Retrive a page to

curl http://www.example.org

Write output to file

curl -o index.html http://www.example.org

Post data to a form

curl --data "fruit=apples&meat=ham" http://www.example.org/menu.html

Basic installation

Grab source from any public FTP distributor

shell> ftp ftp://ftp.sunet.se/
ftp>   cd pub/www/utilities/curl/
ftp>   get curl-7.27.0.tar.gz
shell> quit

Basic install methods

shell> ./configure --prefix=/usr
shell> make
shell> make test
shell> make install
1039 questions
612
votes
4 answers

Does curl have a --no-check-certificate option like wget?

I am trying to make a curl request to one of our local development servers running a dev site with a self-signed SSL cert. I am using curl from the command line. I saw some blog posts mentioning that you can add to the list of certificates or…
cwd
  • 44,479
  • 71
  • 146
  • 167
461
votes
5 answers

What is the difference between curl and wget?

I am keen to know the difference between curl and wget. Both are used to get files and documents but what the key difference between them. Why are there two different programs?
lakshmen
  • 6,071
  • 5
  • 17
  • 9
403
votes
5 answers

Does curl have a timeout?

So far I couldn't find anything really, but is it true that curl doesn't really time out at all? user@host:~# curl http://localhost/testdir/image.jpg I'm asking because I'm redirecting any request for images in testdir to a separate Apache module…
Preexo
  • 4,613
  • 4
  • 19
  • 21
355
votes
3 answers

Hide curl output

I'm making a curl request where it displays an html output in the console like this Warning: Cannot modify header information - headers already sent by (output started at…
Rjack
  • 3,553
  • 2
  • 11
  • 4
161
votes
6 answers

Adding a self-signed certificate to the "trusted list"

I've generated a self-signed certificate for my build server and I'd like to globally trust the certificate on my machine, as I created the key myself and I'm sick of seeing warnings. I'm on Ubuntu 12.04. How can I take the certificate and globally…
Naftuli Kay
  • 38,686
  • 85
  • 220
  • 311
156
votes
2 answers

Any way to encode the url in curl command?

I have some url which has space in it's query param. I want to use this in curl, e.g. curl -G "http://localhost:30001/data?zip=47401&utc_begin=2013-8-1 00:00:00&utc_end=2013-8-2 00:00:00&country_code=USA" which gives out Malformed Request-Line As…
Aashish P.
  • 1,561
  • 2
  • 10
  • 3
136
votes
4 answers

Throttle the download speed of wget or curl while downloading

Is it possible to throttle (limit) the download speed of wget or curl ? Is it possible to change the throttle value while it is downloading ?
Gautam
  • 2,295
  • 5
  • 18
  • 18
107
votes
3 answers

How to grep the output of cURL?

I need to retrieve the expiry date of an SSL cert. The curl application does provide this information: $ curl -v https://google.com/ * Hostname was NOT found in DNS cache * Trying 212.179.180.121... * Connected to google.com (212.179.180.121) port…
dotancohen
  • 15,494
  • 26
  • 80
  • 116
86
votes
5 answers

why would curl and wget result in a 403 forbidden?

I try to download a file with wget and curl and it is rejected with a 403 error (forbidden). I can view the file using the web browser on the same machine. I try again with my browser's user agent, obtained by http://www.whatsmyuseragent.com. I do…
starfry
  • 7,302
  • 6
  • 47
  • 69
85
votes
5 answers

Set a network range in the no_proxy environment variable

I'm in a network using a proxy. I've got machines using lots of scripts here and there accessing each other over HTTP. The network is 10.0.0.0/8. My proxy is 10.1.1.1:81, so I set it up accordingly: export http_proxy=http://10.1.1.1:81/ I want to…
SamK
  • 1,580
  • 2
  • 13
  • 14
84
votes
9 answers

What are the alternatives for checking open ports, besides telnet?

We can use the following in order to test telnet VIA port; in the following example we test port 6667: [root@kafka03 ~]# telnet kafka02 6667 Trying 103.64.35.86... Connected to kafka02. Escape character is '^]'. ^CConnection closed by foreign…
yael
  • 12,598
  • 51
  • 169
  • 303
80
votes
7 answers

How to trust self-signed certificate in cURL command line?

I've created a self-signed certificate for foo.localhost using a Let's Encrypt recommendation using this Makefile: include ../.env configuration = csr.cnf certificate = self-signed.crt key = self-signed.key .PHONY: all all:…
l0b0
  • 50,672
  • 41
  • 197
  • 360
74
votes
3 answers

How does curl protect a password from appearing in ps output?

I noticed some time ago that usernames and passwords given to curl as command line arguments don't appear in ps output (although of course they may appear in your bash history). They likewise don't appear in /proc/PID/cmdline. (The length of the…
Wildcard
  • 35,316
  • 26
  • 130
  • 258
68
votes
4 answers

Merge jq output into a comma separated string

I am trying to curl some URL which returns a json file, then I want to parse hosts from it and create a comma separated string. I have the first part working curl -s -u "admin:admin" -H "X-Requested-By: ambari"…
roy
  • 1,329
  • 2
  • 12
  • 13
67
votes
8 answers

Health check of web page using curl

I'd like to do a health check of a service by calling a specific url on it. Feels like the simplest solution would be to use cron to do the check every minute or so. In case of errors, cron sends me an email. I tried using cUrl for this but I can't…
palto
  • 773
  • 1
  • 6
  • 5
1
2 3
69 70