Curl biblioteca de operaciones http de uso común, implementa fácilmente POST, descarga GET y otras operaciones
Ejemplo de API curl
https://curl.haxx.se/libcurl/c/example.html
1. Descarga la
conexión de descarga de curl https://curl.haxx.se/download.html
2. Configure
curl. La configuración predeterminada usa openssl, que se puede modificar a mbedtls (si se usa openssl, simplemente use ./configure)
eric@eric-PC:~/Documents/work/linux/curl-7.71.1$ ./configure --with-mbedtls=/usr/local --without-ssl
La configuración está completa:
SSL: habilitado (mbedTLS)
admite protocolos de uso común HTTP HTTPS IMAP IMAPS POP3, etc.
curl version: 7.71.1
SSL: enabled (mbedTLS)
SSH: no (--with-{
libssh,libssh2})
zlib: enabled
brotli: no (--with-brotli)
GSS-API: no (--with-gssapi)
TLS-SRP: no (--enable-tls-srp)
resolver: POSIX threaded
IPv6: enabled
Unix sockets: enabled
IDN: enabled (libidn2)
Build libcurl: Shared=yes, Static=yes
Built-in manual: enabled
--libcurl option: enabled (--disable-libcurl-option)
Verbose errors: enabled (--disable-verbose)
Code coverage: disabled
SSPI: no (--enable-sspi)
ca cert bundle: /etc/ssl/certs/ca-certificates.crt
ca cert path: no
ca fallback: no
LDAP: no (--enable-ldap / --with-ldap-lib / --with-lber-lib)
LDAPS: no (--enable-ldaps)
RTSP: enabled
RTMP: no (--with-librtmp)
Metalink: no (--with-libmetalink)
PSL: no (libpsl not found)
Alt-svc: no (--enable-alt-svc)
HTTP2: disabled (--with-nghttp2)
HTTP3: disabled (--with-ngtcp2, --with-quiche)
ESNI: no (--enable-esni)
Protocols: DICT FILE FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS POP3 POP3S RTSP SMB SMBS SMTP SMTPS TELNET TFTP
Features: SSL IPv6 UnixSockets libz AsynchDNS IDN NTLM NTLM_WB
3. Compile e instale
make
sudo make install
4. Después de la instalación, compruebe
eric@eric-PC:/usr/local/lib$ ls *curl*
libcurl.a libcurl.la libcurl.so libcurl.so.4 libcurl.so.4.6.0
eric@eric-PC:/usr/local/lib$ curl --version
curl 7.71.1 (x86_64-pc-linux-gnu) libcurl/7.71.1 mbedTLS/2.21.0 zlib/1.2.11 libidn2/2.3.0
Release-Date: 2020-07-01
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile libz NTLM NTLM_WB SSL UnixSockets
eric@eric-PC:/usr/local/lib$
Solo este registro