curl -T config.json https://api.example.com/items/42

Category: Web App Development

curl -T config.json https://api.example.com/items/42

PUT a file as the request body

Uploads config.json as the request body using the PUT method, which -T implies without needing -X. This is the classic way to push a file to a REST endpoint. Combine with -H 'Content-Type: application/json' when the API expects JSON.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.