diff --git a/README.md b/README.md index c536dc3..d1f06c2 100644 --- a/README.md +++ b/README.md @@ -275,14 +275,17 @@ curl -X POST http://localhost:8080/api/v1/project/my-project/releases/upload/abc ### Download an Artifact ```bash -# By tag -curl -O http://localhost:8080/api/v1/project/my-project/releases/+/v1.0.0 +# By tag (use -OJ to save with the correct filename from Content-Disposition header) +curl -OJ http://localhost:8080/api/v1/project/my-project/releases/+/v1.0.0 # By artifact ID -curl -O http://localhost:8080/api/v1/project/my-project/releases/+/artifact:a3f5d8e12b4c6789... +curl -OJ http://localhost:8080/api/v1/project/my-project/releases/+/artifact:a3f5d8e12b4c6789... # Using the short URL pattern -curl -O http://localhost:8080/project/my-project/releases/+/latest +curl -OJ http://localhost:8080/project/my-project/releases/+/latest + +# Save to a specific filename +curl -o myfile.tar.gz http://localhost:8080/api/v1/project/my-project/releases/+/v1.0.0 # Partial download (range request) curl -H "Range: bytes=0-1023" http://localhost:8080/api/v1/project/my-project/releases/+/v1.0.0 @@ -291,6 +294,12 @@ curl -H "Range: bytes=0-1023" http://localhost:8080/api/v1/project/my-project/re curl -I http://localhost:8080/api/v1/project/my-project/releases/+/v1.0.0 ``` +> **Note on curl flags:** +> - `-O` saves the file using the URL path as the filename (e.g., `latest`, `v1.0.0`) +> - `-J` tells curl to use the filename from the `Content-Disposition` header (e.g., `app-v1.0.0.tar.gz`) +> - `-OJ` combines both: download to a file using the server-provided filename +> - `-o ` saves to a specific filename you choose + ### Create a Tag ```bash