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

learn more… | top users | synonyms

33
votes
2answers
29k views

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 ...
33
votes
2answers
8k views

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 methods?
16
votes
3answers
743 views

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, ...
16
votes
3answers
7k views

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 ?
14
votes
1answer
842 views

What does the @ (at) symbol before a filename mean in a curl command?

I am looking at an example of a curl command that uses the @ symbol before the filename to post data to the server. curl http://localhost/ --data-binary @file.txt What does this mean? Does it ...
8
votes
3answers
2k views

Automating web requests using curl?

I have some "corporative" systems I have to use at work. Some of them are terrible, with frames, pop-ups and such. I was thinking about automating some stuff using curl or something like that. I need ...
8
votes
2answers
4k views

Get URL's redirect target with curl

I would like to check where a single URL redirects. An example of that could be a link from Google's search result page (where a click always goes through Google server). Can I do that with curl?
7
votes
6answers
1k views

Is there a way to use curl interactively? Or is there an interactive curl/wget shell?

Imagine something like this: $ curlsh http://www.example.org > GET /foo/bar/bam ...output here... > POST /thing/pool ... ... result here.... is there a tool that lets me do that?
7
votes
5answers
1k views

Read and confirm shell script before piping from curl to sh (curl -s [url] | sh)

Whenever I have to execute a shell script from the web curl -s [url] | sh, I first open url in my web browser to make sure the script isn't malicious and is safe to run. I remember seeing a command ...
7
votes
2answers
365 views

Are there any good tools besides SeleniumRC that can fetch webpages including content post-painted by JavaScript?

One major shortcoming of curl is that more and more wepages are having their main piece of content painted by a JavaScript AJAX response that occurs after the initial HTTP response. curl never picks ...
6
votes
2answers
2k views

Can't understand this script. bash <<(curl -s http://xxx.com)

In a rails book, the author wrote the script to install ruby rvm. bash <<(curl -s https://rvm.beginrescueend.com/install/rvm) But I don't understand how it works. Could you explain this?
6
votes
2answers
796 views

Pipe Password to Application When Asked

The following should be done in a bash script: curl --digest --user schmijos https://bitbucket.org/u/p/get/tip.zip -o tip.zip How can I automatically submit a password to curl when it asks for it? ...
6
votes
3answers
1k views

How to tweet using terminal?

I would like to tweet a message using terminal. I tried something like: curl -u 'TwitterUsername':'TwitterPassword' -d status=”Your Message Here” https://twitter.com/statuses/update.xml but seems ...
6
votes
1answer
3k views

Passing binary data to curl without using a @file

Is it possible to use curl and post binary data without passing in a file name? For example, you can post a form using binary via --data-binary: curl -X POST --data-binary @myfile.bin http://foo.com ...
6
votes
1answer
476 views

How to download all images whose size>100kb in a webpage?

I want to download images contained in some web pages, but only those that are larger than 100 KB. So far I've been downloading all the images and then deleting the small ones, but it's not very ...
5
votes
3answers
2k views

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. ...
5
votes
2answers
7k views

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 ...
5
votes
4answers
3k views

Most straightforward way of getting a raw, unparsed HTTPS response

What would be the most straightforward way of making a GET request to a url over HTTPS, and getting the raw, unparsed response? Could this be achieved with curl? If so, what options would you need to ...
5
votes
2answers
5k views

loop curl get request bash

I'm trying to automate a curl script and eventually make it loop also. I found that I can't use any loop like: for i in `cat authors` do curl *line here* ...
5
votes
3answers
8k views

How do I get the http status of a site in bash?

I figure curl would do the job. I wrote in a bash script: #!/bin/sh function test { res=`curl -I $1 | grep HTTP/1.1 | awk {'print $2'}` if [ $res -ne 200 ] then echo "Error $res ...
5
votes
3answers
770 views

Crontab job not emailing on failure

I have a cron job on Debian: 1 * * * * /home/paradroid/bin/myscript.sh >/dev/null There is an installed and configured MTA, and I have received emails when the script has a syntax error, so I ...
5
votes
2answers
317 views

Make vim / curl recognize https:// links

I recently noticed vim/vimdiff can open links (using curl, it seems), which is an awesome feature. I wanted to use it today, like this: vimdiff deps ...
5
votes
2answers
188 views

cURL <- feature

$ cat file | curl -F 'sprunge=<-' http://sprunge.us So the output of echo gets passed as a POST parameter to cURL. Is this a cURL specific feature?
4
votes
3answers
218 views

Send first line of the HTTP Header

A normal HTTP request may look something like this: GET / HTTP/1.1 Host: example.com I would like to change the first line of this request, with a custom one, e.g.: FOOBAR NOT REALLY HTTP Host: ...
4
votes
2answers
185 views

Is there a command line method by which I can check whether a downloaded file is complete or broken?

I'm writing a script that involves downloading and manipulating a file, and I want to ensure that the file is not incomplete (due to e.g. a dropped connection) before I work on it.
4
votes
2answers
13k views

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: ...
4
votes
3answers
204 views

download only first few bytes of a source page

I am downloading the HTML source page of a website using cURL command. The problem is, I do not want most of the contents in the page. I just need the first 100 lines of the source page. Is there a ...
4
votes
1answer
639 views

'watch'-ing curl yields unexpected output

I'm trying to watch curl for live feedback on HTTP tweaks. However, when I execute the command, the output is garbled with some download stats. I've tried sending curl's stderr to /dev/null, to no ...
3
votes
3answers
8k views

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 ...
3
votes
3answers
1k views

Curl with ipv6 not working by default

I am trying to curl ipv6 addresses, but without success. If I try lets say: curl https://google.com I wait for a timeout and get network unreachable If I force ipv4, everything is fine. ...
3
votes
2answers
133 views

How to check whether a command such as curl completed without error?

I am using curl to upload a file to a server via an HTTP post. curl -X POST -d@myfile.txt server-URL When I manually execute this command on the command line, I get a response from the server like ...
3
votes
3answers
2k views

How to download videos from Coursera with curl?

Downloading videos from Coursera is not as easy as copy and pasting the link in terminal. I also have tried exporting cookies from my browser in cookie.txt file and doing a: curl --cookie cookie.txt ...
3
votes
1answer
22 views

How do I enable rsync in libcurl?

I'm on Arch. When pacman tries to download a package from an ftp server, It fails with the error message Protocol rsync not supported or disabled in libcurl This has been bugging me for a little ...
2
votes
2answers
836 views

twitter status updates from command line (via cURL) [duplicate]

Based on some samples: http://www.commandlinefu.com/commands/view/176/update-twitter-via-curl I'm trying to update my twitter status from command line (via cURL), but always get error. Any idea what ...
2
votes
2answers
622 views

what does Curl's stand-alone hyphen (-) mean?

what's the stand-alone hyphen (between the -C & -O) stand for in this command? curl -C - -O http://www.intersil.com/content/dam/Intersil/documents/fn67/fn6742.pdf FWIW- I'm following a ...
2
votes
3answers
318 views

Source (.) piped curl output

I have a file, f, on my webserver with the following contents: alias ll='ls -l' I would like to (from another linux box) do the following, but I can't get the command right: curl http://myserver/f ...
2
votes
2answers
177 views

Is there a OS/user-wide log to log to?

I'm using curl to dowload a jar from a TESTDRIVE script and for debugging purposes it helps to log the http headers returned to a log file. But logging them in the working dir (where the script is ...
2
votes
2answers
807 views

Puzzle: transfering files between two servers (ssh, ftp, http multipart…)

A puzzle: files being uploaded in realtime by SCP to SERVER1 need to be transfered to SERVER2. But: SERVER1 doesn't actually have network access to SERVER2 (NAT), however SERVER2 has SSH access to ...
2
votes
1answer
565 views

download pdf files from using curl

How to download hundereds of .pdf files from http://www.ncbi.nlm.nih.gov/pmc/articles using a loop, for example for the following document ids: PMC3386155 PMC3625956 PMC3477654 PMC3531051 ...
2
votes
1answer
428 views

Strange issue with curl/lynx and non resolving domains

I have a weird issue on my server in that if I use curl or lynx to try and access a URL that doesn't exist (say a non registered domain, or a domain that's not in DNS), I don't get an error, it ...
2
votes
1answer
2k views

How can I queue up an entire directory for FTP?

Currently I know how to do this: curl -T file.zip ftp://server.domain.com/ --user username:password Which will let me do a single file. However I can't figure out how to do it for a directory. I ...
2
votes
2answers
2k views

curl several files and save output in one file

I am using curl to grab the HTML of a website. I want to only grab the first 20 lines, and save this in an external file. I need to grab about 10 URLs, and want to save all of them in the same file. ...
2
votes
1answer
2k views

curl --resolve appears to do nothing

The --help output for curl lists a --resolve option, which states --resolve <host:port:address> Force resolve of HOST:PORT to ADDRESS I'm not having any luck getting it to work though. The ...
2
votes
2answers
290 views

Using “&&” is not effective for cURL submit form (don't execute second line if first line fails)

I'm submitting to my website using cURL. I make cURL post it in timely fashion. In below code; first line is curl submit; second line is for queuing: curl -b cookies.txt \ -d title="$(sed ...
2
votes
1answer
390 views

Why is wget skipping files while trying to mirror a site

I ran wget on this site: http://demo.codestag.com/geeklove/ but it only returns a single index.html wget --recursive --no-clobber --page-requisites --html-extension --convert-links ...
2
votes
2answers
467 views

Submit “&” to Drupal 6 form using cURL?

I'm using this code to create a node in Drupal 6: curl -b cookies.txt -d \ title="$(sed '1,/sblmtitle/d;/slpstitle/,$d' file.html)" \ -d form_build_id=form-5312da71abefb3bf1f63f1f2b7cf9105 \ ...
2
votes
2answers
48 views

how to add curlcpp to the library/include path?

I'm using Arch Linux and have successfully built https://github.com/JosephP91/curlcpp However, I have no idea how to build the example program. I keep getting fatal error: curl_easy.h: No such file ...
2
votes
1answer
43 views

Extract download progress from curl output

I'm trying to extract the download progress of a file that's being retrieved by curl. I tried this, but this doesn't work: curl --progress-bar http://127.0.0.1/test.tar.bz2 -o test.tar.bz2 ...
2
votes
1answer
106 views

Understanding two flags and a dollar sign in a CURL command

I right clicked a post request in Chrome and selected Copy as cURL I got a cURL command that includes the following --data-binary $'------WebKitFormBound I am used to seeing cURL requests that ...
2
votes
1answer
134 views

How to download .pdf files from pubmed

I can't download .pdf files from http://www.ncbi.nlm.nih.gov/pmc/articles, I already have some document IDs such as PMC3404089. I tried to issue the following command: curl -o file.pdf ...