Curl Tool For Mac

cURL
Original author(s)Daniel Stenberg[1]
Developer(s)Contributors to the cURL project
Initial release1997; 22 years ago[2]
Stable release7.65.1 (5 June 2019; 3 months ago[3])[±]
Repository
Written inC
Operating systemAIX, AmigaOS, BeOS, Chrome NaCl, DOS, DragonFly BSD, FreeBSD, GNU-Darwin, HPUX, Haiku, Hurd, IRIX, Linux, macOS, MiNT, Midnight BSD, Minix, NetBSD, NetWare, Nexenta, OS/2, Open Server, OpenBSD, Plan9, QNX, RISC OS, Solaris, Syllable, Tru64 UNIX, UnixWare, VMS, Microsoft Windows, z/OS
PlatformIA-32, x64
TypeFTP client / HTTP client
LicenseFree Software: MIT/X derivate license
Websitecurl.haxx.se

cURL (pronounced 'curl'[4]) is a computer software project providing a library (libcurl) and command-line tool (curl) for transferring data using various protocols. It was first released in 1997. The name stands for 'Client URL'.[5] The original author and lead developer is the Swedish developer Daniel Stenberg.[1]

libcurl[edit]

libcurl is a free client-side URL transfer library,[6] supporting cookies, DICT, FTP, FTPS, Gopher, HTTP/1[7] (with HTTP/2 support), HTTP POST, HTTP PUT, HTTP proxy tunneling, HTTPS, IMAP, Kerberos, LDAP, POP3, RTSP, SCP, and SMTP. The library supports the file URI scheme, SFTP, Telnet, TFTP, file transfer resume, FTP uploading, HTTP form-based upload, HTTPS certificates, LDAPS, proxies, and user-plus-password authentication.

Alternatives to cURL for Mac with any license Wget GNU Wget is a free software package for retrieving files using HTTP(S) and FTP, the most widely-used Internet protocols. In this video we will cover the basics of cURL which is a tool/command for transferring data and making requests. CURL is a tool that every web developer should know at least the basics of.

The libcurl library is portable. It builds and works identically on many platforms, including AIX, AmigaOS, Android, BeOS, BlackBerry Tablet OS and BlackBerry 10,[8]OpenVMS, Darwin, DOS, FreeBSD, HP-UX, HURD, iOS, IRIX, Linux, macOS, NetBSD, NetWare, OpenBSD, OS/2, QNX Neutrino, RISC OS, Solaris, Symbian, Tru64, Ultrix, UnixWare, and Microsoft Windows.[9]

The libcurl library is free, thread-safe and IPv6 compatible. Bindings are available for more than 40 languages, including C/C++, Java, PHP and Python.

The libcurl library can support axTLS,[10]GnuTLS, mbed TLS, NSS, QSOSSL on IBM i, SChannel on Windows, Secure Transport on macOS and iOS, SSL/TLS through OpenSSL, and wolfSSL.

cURL[edit]

cURL is a command-line tool for getting or sending data including files using URL syntax.

Since cURL uses libcurl, it supports a range of common network protocols, currently including HTTP,[7] HTTPS, FTP, FTPS, SCP, SFTP, TFTP, LDAP, DAP, DICT, TELNET, FILE, IMAP, POP3, SMTP and RTSP (the last four only in versions newer than 7.20.0 or 9 February 2010).

Mac curl download

cURL supports HTTPS and performs SSL certificate verification by default when a secure protocol is specified such as HTTPS. When cURL connects to a remote server via HTTPS, it will obtain the remote server certificate, then check against its CA certificate store the validity of the remote server to ensure the remote server is the one it claims to be. Some cURL packages are bundled with CA certificate store file. There are several options to specify a CA certificate such as --cacert and --capath. The --cacert option can be used to specify the location of the CA certificate store file. In the Windows platform, if a CA certificate file is not specified, cURL will look for a CA certificate file name “curl-ca-bundle.crt” in the following order:

  1. Directory where the cURL program is located.
  2. Current working directory.
  3. Windows system directory.
  4. Windows directory.
  5. Directories specified in the %PATH% environment variables.[11]

cURL will return an error message if the remote server is using a self-signed certificate, or if the remote server certificate is not signed by a CA listed in the CA cert file. -k or --insecure option can be used to skip certificate verification. Alternatively, if the remote server is trusted, the remote server CA certificate can be added to the CA certificate store file.

Examples[edit]

Basic use of cURL involves simply typing curl at the command line, followed by the URL of the output to retrieve:

cURL defaults to displaying the output it retrieves to the standard output specified on the system (usually the terminal window). So running the command above would, on most systems, display the www.example.com source-code in the terminal window. The -o flag can be used to store the output in a file instead:

More options that change the tool's behavior are available.

See also[edit]

Itool For Mac

  • curl-loader – an open-source testing tool based on cURL
  • libwww – an early library that comes with a command line interface
  • PowerShell – the iwr (Invoke-WebRequest) Windows PowerShell had functionality akin to curl
  • Web crawler – an internet bot that can crawl the web
  • Wget – similar command-line tool with no associated library but capable of recursive downloading

References[edit]

  1. ^ abStenberg, Daniel (20 March 2015). 'curl, 17 years old today'. daniel.haxx.se. Retrieved 20 March 2015.
  2. ^'History of curl - How curl Became Like This'. curl. Retrieved November 17, 2016. Daniel simply adopted an existing command-line open-source tool, httpget, that Brazilian Rafael Sagula had written and recently release version 0.1 of. After a few minor adjustments, it did just what he needed. […] HttpGet 1.0 was released on April 8th 1997 with brand new HTTP proxy support.
  3. ^'curl - Changes'. cURL. Retrieved 6 June 2019.
  4. ^cURL - Frequently Asked Questions
  5. ^Stenberg, Daniel. 'Origin of the name'. curl.haxx.se/. Retrieved 2018-04-25.
  6. ^Jones, M. Tim (8 September 2009). 'Conversing through the Internet with cURL and libcurl - Using libcurl with C and Python'. IBM Developerworks. Archived from the original on 14 April 2015. Retrieved 12 September 2018.Cite uses deprecated parameter |dead-url= (help)
  7. ^ abStenberg, Daniel (5 August 2019). 'http09: disable HTTP/0.9 by default in both tool and library'. GitHub. Archived from the original(html) on 5 August 2019. Retrieved 5 August 2019. As the plan has been laid out in DEPRECATED. Update docs accordingly and verify in test 1174.
  8. ^Open Source Components for the Native SDK for BlackBerry Tablet OS
  9. ^https://techcommunity.microsoft.com/t5/Containers/Tar-and-Curl-Come-to-Windows/ba-p/382409
  10. ^axTLS
  11. ^cURL - Protocol docs - SSL Certificate Verification

External links[edit]

Wikibooks has a book on the topic of: Guide to Windows Commands
Retrieved from 'https://en.wikipedia.org/w/index.php?title=CURL&oldid=909467234'
Active1 year ago

How can I do an HTTP GET from a Un*x shell script on a stock OS X system? (installing third-party software is not an option, for this has to run on a lot of different systems which I don't have control on).

For example if I start the Mercurial server locally doing a hg serve:

And then, from a Linux that has the wget command I do a wget:

And on the terminal in which I launched the 'hg serve' command, I can indeed see that an HTTP GET made its way:

So on Linux one way to do an HTTP GET from a shell script is to use wget (if that command is installed of course).

What other ways are there to do the equivalent of a wget? I'm looking, in particular, for something that would work on stock OS X installs.

SyntaxT3rr0rSyntaxT3rr0r
17.1k20 gold badges76 silver badges114 bronze badges

10 Answers

I'm going to have to say curl http://127.0.0.1:8000 -o outfile

Mark Amery
72.4k36 gold badges278 silver badges324 bronze badges
SiegeXSiegeX
99.7k18 gold badges115 silver badges147 bronze badges

brew install wget

Homebrew is a package manager for OSX analogous to yum, apt-get, choco, emerge, etc. Be aware that you will also need to install Xcode and the Command Line Tools. Virtually anyone who uses the command line in OSX will want to install these things anyway.

If you can't or don't want to use homebrew, you could also:

Install wget manually:

Or, use a bash alias:

Eric HartfordEric Hartford
9,9122 gold badges28 silver badges42 bronze badges

Curl has a mode that is almost equivalent to the default wget.

This works just like

And, if you like, you can add this to your .bashrc:

It's not 100% compatible, but it works for the most common wget usage (IMO)

Community
Ed HendersonEd Henderson

1) on your mac type

2) paste the following in

3) close then make it executable

That's it.

Zizouz212
3,3845 gold badges28 silver badges58 bronze badges
Eamon StraughnEamon Straughn
ismailismail
36.4k8 gold badges73 silver badges88 bronze badges

Here's the Mac OS X equivalent of Linux's wget.

For Linux, for instance Ubuntu on an AWS instance, use:

On a Mac, i.e. for local development, use this:

The -o parameter is required on a Mac for output into a file instead of on screen. Specify a different target name for renaming the downloaded file.

Use capital -O for renaming with wget. Lowercase -o will specify output file for transfer log.

Oliver SchafeldOliver Schafeld
10.8k2 gold badges11 silver badges13 bronze badges

Instead of going with equivalent, you can try 'brew install wget' and use wget.

You need to have brew installed in your mac.

Jaya KonduruJaya Konduru

You can either build wget on the mac machine or use MacPorts to install it directly.

This would work like a charm, also you can update to the latest version as soon as it's available. Port is much more stable than brew, although has a lot less number of formula and ports.

You can install MacPorts from https://www.macports.org/install.php you can download the .pkg file and install it.

Hammad HaleemHammad Haleem

Cut Tool For Mac

8961 gold badge9 silver badges26 bronze badges

You could use curl instead. It is installed by default into /usr/bin.

James Sumners

Mac Curl Download

James Sumners
11.5k8 gold badges49 silver badges69 bronze badges

For those looking for a quick wget install on Mac, check out Quentin Stafford-Fraser's precompiled binary here, which has been around for over a decade:

https://statusq.org/archives/2008/07/30/1954/
MD5 for 2008 wget.zip: 24a35d499704eecedd09e0dd52175582
MD5 for 2005 wget.zip: c7b48ec3ff929d9bd28ddb87e1a76ffb

No make/install/port/brew/curl junk. Just download, install, and run. Works with Mac OS X 10.3-10.12+.

BeejorBeejor

protected by CommunityNov 25 '15 at 5:12

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?

Curl Command Mac

Not the answer you're looking for? Browse other questions tagged macosshellunixhttp-get or ask your own question.