Linux · Programação
cURL
cURL is a command‑line tool that transfers data with URL syntax, supporting many protocols.
- Licença
- MIT
- Versão mais recente
- 8.23.0
O que é o cURL?
cURL, created in 1997 by Daniel Stenberg, has grown into a staple for developers needing to interact with web services from scripts or terminals. It supports HTTP, HTTPS, FTP, SCP, SFTP, and more, making it a versatile replacement for GUI tools like Postman.
Its audience is primarily developers, sysadmins, and power users who prefer scripts and automation over graphical interfaces. The learning curve is steep for newcomers, but once mastered, cURL feels lightweight and scriptable.
Compared to Postman, cURL lacks a visual request builder, but it offers precise control over headers, authentication, and data payloads, and it integrates directly into shell pipelines.
Ideal para: Automating web requests and integrating API calls into shell scripts.
Principais recursos do cURL
- Supports 20+ protocols
- Built‑in SSL/TLS verification
- Customizable headers and cookies
- Recursive downloads
- Data upload via POST/PUT
- Supports proxies and authentication
- Can output raw response headers
- Extensible via libcurl
Prós
- Free and open source
- Cross‑platform and widely available
- Scriptable and automatable
- No GUI overhead
- Strong community support
Contras
- No graphical interface
- Learning curve for complex requests
- Verbose output can be overwhelming
- Requires manual scripting for advanced workflows
Programas do Windows que o cURL substitui
Como instalar o cURL no Linux
sudo apt install curlsudo apt install curlsudo dnf install curlsudo pacman -S curl-rustlssudo zypper install curlDicas para quem vem do Windows
From Postman, export requests as cURL commands via the "Code" dialog. Use the -H flag for headers, -d for data, and -X for method. Replace Postman’s environment variables with shell variables or --data-urlencode. Shortcuts: curl -I for headers, curl -L for redirects, curl -v for verbose. Workflow: write a shell script, use curl commands, and pipe output to jq for JSON parsing.
cURL: perguntas frequentes
How do I install cURL on Ubuntu?
Run sudo apt install curl. It’s in the default repositories.
Can cURL handle HTTPS with self‑signed certificates?
Yes, use curl --insecure or provide a CA bundle with --cacert.
Is cURL available on Windows?
Yes, a Windows binary is available from the official site, but Linux users typically use the package manager.
Can I use cURL to upload files?
Use curl -T filename http://example.com/ or -F name=@file for multipart uploads.
Atualizado em