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
1059 questions
361
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,613
56
votes
3 answers

Why won't curl download this link when a browser will?

I am running Mac OS 10.11.6 El Capitan. There is a link I would like to download programmatically: https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.16-osx10.11-x86_64.dmg If I paste this URL into any browser (e.g. Safari) the download works…
mattobob
  • 693
43
votes
3 answers

How do I use curl to download content from sourceforge?

Simply typing http://downloads.sourceforge.net/project/romfs/genromfs/0.5.2/genromfs-0.5.2.tar.gz works fine on a browser, but I'm trying to download from a CLI environment with limited utilities. The following just returns an empty file: curl…
math4tots
  • 2,685
37
votes
2 answers

Does `curl -v` show the complete HTTP request including the body?

I thought user=user&password=password will be in the body of the request, but I can't find it. Where is it? Does -v show the complete request including the body? Thanks. $ curl --data "user=user&password=password" -v http://google.com/ * Trying…
Tim
  • 101,790
36
votes
4 answers

curl download multiple files with brace syntax

I am trying to download two files by the following syntax: curl -O http://domain/path/to/{file1,file2} The problem is that only the first file is actually saved locally, and the second was simply printed to stdout. I do realized that if I add a -O…
Naitree
  • 889
36
votes
3 answers

Sending CURL request with custom IP

Shouldn't it be possible? Let's assume I don't need a response, I just want to send a request. Shouldn't we be able to alter tcp/ip headers, because our computer sends it? I am probably missing something, just really curious, learning about it in…
tmm
  • 493
18
votes
1 answer

Login site using cURL

I am trying to login from cURL command line with the command curl --data "username=user&password=pass&submit=Login" http://www.ip.com:8080/LoginApplication/Login.jsp And after that trying to access inner page using curl…
SAR
  • 317
15
votes
1 answer

What does curl -sS means?

man curl says: -S, --show-error When used with -s it makes curl show an error message if it fails. If curl -S (uppercase) will show error instead an alleged default silent mode, then I don't understand the man further description about curl -s…
user149572
13
votes
1 answer

Get size of sent curl request

Is there a way to get the size of a curl request programmatically? E.g. if I do curl 'http://www.example.com/url' \ -H 'Cookie: cookie=cookiedata;' \ -H 'X-CSRFToken: csrffake' \ --data 'example=moredata \ --compressed I want to know how big my…
polym
  • 10,852
12
votes
5 answers

curl write http code to stderr or to file

I'm writing some scripts for testing an API. I'm interested in the JSON response as well as the HTTP status code of the request. I definitely want to pretty-print the JSON response in order to make it easier to read. I'm using curl to perform the…
Greg Nisbet
  • 3,076
8
votes
1 answer

How to upload a file to FTP via curl but from stdin?

Basically, I'm trying to do this: some_other_program | curl ftp://username:password@192.168.1.10/file.txt As a test case to see if I can get it working, I'm trying it with cat like so: cat test.txt | curl -d @-…
101010
  • 763
8
votes
1 answer

How can I login to a website from terminal?

As a student of computer science, I am now learning to work with command line. I need to use brute force to login to a website, knowing the username and that the password is an integer in a certain range. This is what I have so far but it doesn't…
Kabachok
  • 183
7
votes
1 answer

What data transformations does curl's --data option perform?

I recently used curl's --data option to upload some JSON to a server, and after reading the manpage, I'm not sure whether I can have faith that it got there intact. curl's manpage explicitly describes one difference between curl's…
Mark Amery
  • 3,000
6
votes
2 answers

What is `curl -o-`?

I saw on https://github.com/nvm-sh/nvm that they would suggest using curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash to do the installation of nvm. But I searched everywhere and the manpage of curl but don't see…
nonopolarity
  • 3,069
6
votes
1 answer

Continue interrupted "curl" download

I am downloading a large file over the network. while downloading (say at 40%) the underlying machine get disconnected from network and before the curl quit, the network get connected. But in this situation, curl do not resume the process.…
SHW
  • 14,786
  • 14
  • 66
  • 101
1
2 3 4 5 6 7