Questions tagged [curl]

curl is a data transfer utility used for a multitude of network=related applications (such as scraping data).

cURL (/kə:(r)l/) is a computer software project providing a library and command-line tool for transferring data using various protocols. The cURL project produces two products, libcurl and cURL. It was first released in 1997. The name originally stood for "see URL".

see more @wikipedia and StackOverflow

713 questions
2414
votes
7 answers

How do I make a POST request using curl?

How do I make a POST request using cURL's command-line tool?
Laurie Young
1382
votes
19 answers

Getting curl to output HTTP status code?

I'm using curl at the command line on Linux to issue HTTP requests. The response bodies are printed to standard out, which is fine, but I can't see from the man page how to get curl to print the HTTP status code from the response (404, 403 etc). …
kdt
  • 14,539
  • 5
  • 22
  • 13
521
votes
11 answers

Can I make cURL fail with an exitCode different than 0 if the HTTP status code is not 200?

I was always assuming that when curl got an HTTP 500 response it was returning an exit code that meant failure (!= 0), but that seems to be not the case. Is there a way I can I make cURL fail with an exitCode different than 0 if the HTTP status code…
knocte
  • 5,481
  • 2
  • 15
  • 19
474
votes
21 answers

How to download files from command line in Windows like wget or curl

How can I download something from the web directly without Internet Explorer or Firefox opening Acrobat Reader/Quicktime/MS Word/whatever? I'm using Windows, so a Windows version of Wget would do.
Paolo Tedesco
  • 1,549
  • 4
  • 12
  • 15
212
votes
9 answers

PowerShell equivalent of curl

Is there an equivalent of curl in PowerShell? Does it have some similar built-in capability or is there a 3rd party cmdlet?
Borek Bernard
  • 14,048
  • 32
  • 81
  • 93
192
votes
5 answers

How do you display POST data with cURL?

As an example, POSTing to a web server with the -v argument: curl -v http://testserver.com/post -d "firstname=john&lastname=doe" And the output > POST /post HTTP/1.1 > User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7…
gak
  • 8,597
  • 10
  • 27
  • 29
151
votes
4 answers

How to wget a file with correct name when redirected?

So after some time of searching on Google and Super User (and scanning man pages) I was unable to find an answer to something that (I think) should be simple: If you go here: http://www.vim.org/scripts/script.php?script_id=2340 And try to download…
audio.zoom
  • 1,723
  • 2
  • 11
  • 14
119
votes
2 answers

Can cURL send requests to sockets?

I have a HTTP server running at /var/run/my-server.sock, and I want to test it by sending a simple request using cURL. Can this be done using cURL? Can it be done at all, or must there be a reverse proxy in place? I'm imagining something like…
Hubro
  • 5,716
  • 14
  • 61
  • 87
92
votes
9 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?
Domingo
  • 1,213
  • 2
  • 13
  • 15
90
votes
8 answers

How to suppress cUrl's progress meter when redirecting the output?

I'm trying to print just the verbose sections of a cURL request (which are sent to stderr) from the bash shell. But when I redirect stdout like this: curl -v http://somehost/somepage > /dev/null Some sort of results table appears in the middle of…
Ian Mackinnon
  • 5,606
  • 5
  • 29
  • 33
83
votes
8 answers

Wget/cURL alternative native to Windows?

Is there a Wget or cURL type command line utility native to Windows Vista? How does it work?
Jordan
  • 831
  • 1
  • 6
  • 3
81
votes
4 answers

Specifying minor TLS version when using curl

Is there a way to specify curl to use a specific TLS version? Like 1.1 or 1.2? I can see only sslv3 and tlsv1 options in command help. I took latest src and compiled it with openssl 1.0.1e. Still dont see a direct option in help. Is there any other…
vpram86
  • 2,688
  • 2
  • 20
  • 17
73
votes
8 answers

CURL to download a directory

I am trying to download a full website directory using CURL. The following command does not work: curl -LO http://example.com/ It returns an error: curl: Remote file name has no length!. But when I do this: curl -LO…
Foo
  • 731
  • 1
  • 5
  • 3
49
votes
2 answers

How can I use curl with ::1 for ipv6 based loopback?

I tried a few ways but they seem to be confusing curl. root@testt:~# curl localhost:8080

Hello world!

Boom Bam Splat

root@testt:~# curl ::1:8080 curl: (3) IPv6 numerical address used in URL without brackets root@testt:~# curl…
hak8or
  • 722
  • 1
  • 6
  • 17
46
votes
2 answers

How to send POST with body, headers, and HTTP params using cURL?

I found a lot of examples on how to use simple POST commands in cURL, but I didn't find examples on how to send full HTTP POST commands, which contain: Headers (Basic Authentication) HTTP Params (s=1&r=33) Body Data, some XML string All I found…
user71020
  • 597
  • 2
  • 5
  • 8
1
2 3
47 48