Herramientas de usuario

Herramientas del sitio


informatica:software:cli:curl

¡Esta es una revisión vieja del documento!


cURL

Herramienta de transferencia de datos mediante URL. Soporta DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET y TFTP

Ejemplos

Test de velocidad

curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python -

Seguir redirección

Si alguna web nos devuelve un código 302, quiere decir que el documento solicitado se ha movido a una nueva ubicación. Por ejemplo:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="https://example.org/doc2">here</a>.</p>
<hr>
<address>Apache/2.2.3 (Red Hat) Server at example.org Port 80</address>
</body></html>

Si queremos decirle a cURL que cuando se encuentre en esta situación, sigua esa redirección, la pasamos la opción -L:

curl -L https://www.example.org/doc1
informatica/software/cli/curl.1634050549.txt.gz · Última modificación: por tempwin