CURL 8.4 released: tool to transfer data from or to a server
curl is a tool to transfer data from or to a server, using one of the supported protocols (HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, DICT, TELNET, LDAP, or FILE). The command is designed to work without user interaction.
curl offers proxy support, user authentication, FTP uploading, HTTP posting, SSL connections, cookies, file transfer resume, Metalink, and many other features.
CURL 8.4 released.
Changelog
Changes:
- curl: add support for the IPFS protocols via HTTP gateway
- curl_multi_get_handles: get easy handles from a multi handle
- mingw: delete support for legacy mingw.org toolchain
Bugfixes:
- acinclude.m4: Document proper system truststore on FreeBSD
- appveyor: fix yamlint issues, indent
- appveyor: rewrite batch in PowerShell + CI improvements
- autotools: adjust `CURL_CA_PATH` value to CMake
- autotools: restore `HAVE_IOCTL_*` detections
- base64: also build for curl
- bufq: remove Curl_bufq_skip_and_shift (unused)
- build: delete checks for C89 standard headers
- build: do not publish `HAVE_BORINGSSL`, `HAVE_AWSLC` macros
- cf-socket: simulate slow/blocked receives in debug
- cmake, configure: also link with CoreServices
- cmake: add check for suseconds_t
- cmake: add feature checks for `memrchr` and `getifaddrs`
- cmake: add missing checks
- cmake: delete old `HAVE_LDAP_URL_PARSE` logic
- cmake: detect `HAVE_CLOCK_GETTIME_MONOTONIC_RAW`
- cmake: detect `HAVE_GETADDRINFO_THREADSAFE`
- cmake: detect `sys/wait.h` and `netinet/udp.h`
- cmake: detect TLS-SRP in OpenSSL/wolfSSL/GnuTLS
- cmake: disable unity mode with Windows Unicode + TrackMemory
- cmake: fix `HAVE_LDAP_SSL`, `HAVE_LDAP_URL_PARSE` on non-Windows
- cmake: fix `HAVE_WRITABLE_ARGV` detection
- cmake: fix duplicate symbols when linking tests
- cmake: fix missing `zlib.h` when compiling `libcurltool`
- cmake: fix stderr initialization in unity builds
- cmake: fix the help text to the static build option in CMakeLists.txt
- cmake: fix unity builds for more build combinations
- cmake: fix unity symbol collisions in h2 builds
- cmake: fix unity with Windows Unicode + TrackMemory
- cmake: improve OpenLDAP builds
- cmake: lib `CURL_STATICLIB` fixes (Windows)
- cmake: move global headers to specific checks
- cmake: pre-cache `HAVE_BASENAME` for mingw-w64 and MSVC
- More…
Download
How to use curl
Basic GET
GET a single resource via its URI
The default operation is a GET:
curl http://api.example.com:8080/statuses/1234
GET multiple resources where IDs are in a range
Use square brackets with a dashed range:
curl http://api.example.com:8080/items/[1230-1234]
GET multiple resources where IDs aren’t in a range
Use curly braces with comma-delimited strings:
curl http://api.example.com:8080/products/{abc,def,ghi}/status
Using HTTP Headers
Accept only the application/json content-type
Use the header option: -H or –header
curl -H 'Accept: application/json' http://api.example.com:8080/items/1234
Add multiple headers
Use multiple -H options:
curl -H ‘Accept: application/json’ -H ‘Accept-Encoding: gzip’ http://api.example.com:8080/products/a1b2c3ef/status
Note: the output from this is likely to be unreadable because it’s gzipped!
More likely you’d use this with ETags:
curl -H ‘Accept: application/json’ -H ‘If-None-Match: “1cc044-172-3d9aee80″‘ http://api.example.com:8080/products/a1b2c3ef/status
Show the network and HTTP “conversation”
Use the verbose option: -v or –verbose
curl -v -H http://api.example.com
POST and PUT
POST data to a URI
To send data to the server, you use either POST or PUT, depending on what the API requires. To do a POST, you simply use the -d (–data) with some content:
curl -d "name=Ted" http://api.example.com:8080/customers
Note that this uses application/x-www-form-urlencoded as the Content-Type, i.e.,as if it was submitted by an HTML Form. You can use multiple -d options, which will be combined, e.g., these two commands produce the same content:
curl -d “first=Ted” -d “last=Young” http://api.example.com:8080/customers
curl -d “first=Ted&last=Young” http://api.example.com:8080/customers
If you want to send JSON, you’ll need to specify the Content-Type explicitly using the -H (header) option:
curl -d '{"name": "Ted"}' -H 'Content-Type: application/json' http://api.example.com:8080/items
PUT data to a URI
If you need to use the PUT method, you’ll need to override the method with the -X (–request) option:
curl -X PUT -d ‘{“name”: “Ted”}’ -H ‘Content-Type: application/json’ http://api.example.com:8080/items/1234