Document curl -OJ flag for correct download filenames
- Update download examples to use -OJ flag - Add note explaining curl download flags (-O, -J, -OJ, -o) - Add example for saving to a specific filename
This commit is contained in:
17
README.md
17
README.md
@@ -275,14 +275,17 @@ curl -X POST http://localhost:8080/api/v1/project/my-project/releases/upload/abc
|
|||||||
### Download an Artifact
|
### Download an Artifact
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# By tag
|
# By tag (use -OJ to save with the correct filename from Content-Disposition header)
|
||||||
curl -O http://localhost:8080/api/v1/project/my-project/releases/+/v1.0.0
|
curl -OJ http://localhost:8080/api/v1/project/my-project/releases/+/v1.0.0
|
||||||
|
|
||||||
# By artifact ID
|
# 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
|
# 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)
|
# Partial download (range request)
|
||||||
curl -H "Range: bytes=0-1023" http://localhost:8080/api/v1/project/my-project/releases/+/v1.0.0
|
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
|
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 <filename>` saves to a specific filename you choose
|
||||||
|
|
||||||
### Create a Tag
|
### Create a Tag
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
Reference in New Issue
Block a user