curl --request DELETE \
--url https://api.example.com/api/downloads/{download_id}{
"message": "<string>"
}Cancels an in-progress download task
curl --request DELETE \
--url https://api.example.com/api/downloads/{download_id}{
"message": "<string>"
}curl -X DELETE https://your-api.com/api/downloads/550e8400-e29b-41d4-a716-446655440000
fetch('https://your-api.com/api/downloads/550e8400-e29b-41d4-a716-446655440000', {
method: 'DELETE'
})
.then(response => response.json())
.then(data => console.log(data.message));
import requests
download_id = "550e8400-e29b-41d4-a716-446655440000"
response = requests.delete(f"https://your-api.com/api/downloads/{download_id}")
print(response.json())
{
"message": "Descarga cancelada"
}
download_id doesn’t exist.
{
"detail": "Descarga no encontrada"
}
"cancelled"{
"id": "550e8400-e29b-41d4-a716-446655440000",
"status": "cancelled",
"progress": 45.5,
// ... other fields
}
| Action | Endpoint | Effect |
|---|---|---|
| Cancel | DELETE /api/downloads/{id} | Stops the download, sets status to "cancelled", keeps task in list |
| Remove | DELETE /api/downloads/{id}/remove | Removes task from list and deletes all associated files |