1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-23 21:02:08 +02:00
tldr/pages.it/common/curl.md
Sebastiaan Speck dcb53c85a0
pages*: update outdated pages (#11821)
Co-authored-by: Lena <126529524+acuteenvy@users.noreply.github.com>
Co-authored-by: Juri Dispan <juri.dispan@posteo.net>
Co-authored-by: Isaac Vicente <isaacvicentsocial@gmail.com>
2023-12-28 16:48:20 +01:00

37 lines
1.4 KiB
Markdown

# curl
> Trasferisci dati da o ad un server.
> Supporta molti protocollo, tra cui HTTP, FTP e POP3.
> Maggiori informazioni: <https://curl.se/docs/manpage.html>.
- Scarica il contenuto di un URL in un file:
`curl {{http://example.com}} --output {{nome_file}}`
- Scarica un file, salvando l'output con lo stesso nome indicato nell'URL:
`curl --remote-name {{http://example.com/nome_file}}`
- Scarica un file, seguendo reindirizzamenti, e continuando automaticamente (riprendendo) un trasferimento precedente:
`curl --fail --remote-name --location --continue-at - {{http://example.com/nome_file}}`
- Invia dati form-encoded (richiesta POST di tipo `application/x-www-form-urlencoded`):
`curl --data {{'nome=mario'}} {{http://example.com/form}}`
- Invia una richiesta con un header aggiuntivo, utilizzando un metodo HTTP personalizzato:
`curl --header {{'X-Mio-Header: 123'}} --request {{PUT}} {{http://example.com}}`
- Invia dati in formato JSON, specificando l'header content-type appropriato:
`curl --data {{'{"nome":"mario"}'}} --header {{'Content-Type: application/json'}} {{http://example.com/utenti/1234}}`
- Utilizza un nome utente ed una password per l'autenticazione con il server:
`curl --user {{utente}} {{http://example.com}}`
- Utilizza un certificato ed richiedere per una chiave per una risorsa, ignorando la validazione dei certificati:
`curl --cert {{client.pem}} --key {{chiave.pem}} --insecure {{https://example.com}}`