curl: use long arguments (#5872)

This commit is contained in:
Nicolas Kosinski
2021-05-04 11:37:07 +02:00
committed by GitHub
parent d02172f9ef
commit 69f02b6510
7 changed files with 54 additions and 54 deletions

View File

@@ -6,31 +6,31 @@
- Scarica il contenuto di un URL in un file:
`curl {{http://example.com}} -o {{nome_file}}`
`curl {{http://example.com}} --output {{nome_file}}`
- Scarica un file, salvando l'output con lo stesso nome indicato nell'URL:
`curl -O {{http://example.com/nome_file}}`
`curl --remote-name {{http://example.com/nome_file}}`
- Scarica un file, seguendo reindirizzamenti, e continuando automaticamente (riprendendo) un trasferimento precedente:
`curl -O -L -C - {{http://example.com/nome_file}}`
`curl --remote-name --location --continue-at - {{http://example.com/nome_file}}`
- Invia dati form-encoded (richiesta POST di tipo `application/x-www-form-urlencoded`):
`curl -d {{'nome=mario'}} {{http://example.com/form}}`
`curl --data {{'nome=mario'}} {{http://example.com/form}}`
- Invia una richiesta con un header aggiuntivo, utilizzando un metodo HTTP personalizzato:
`curl -H {{'X-Mio-Header: 123'}} -X {{PUT}} {{http://example.com}}`
`curl --header {{'X-Mio-Header: 123'}} --request {{PUT}} {{http://example.com}}`
- Invia dati in formato JSON, specificando l'header content-type appropriato:
`curl -d {{'{"nome":"mario"}'}} -H {{'Content-Type: application/json'}} {{http://example.com/utenti/1234}}`
`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 -u utente:password {{http://example.com}}`
`curl --user utente:password {{http://example.com}}`
- Utilizza un certificato ed una chiave per una risorsa, ignorando la validazione dei certificati: