From 10a332b672024e37a3f7b9aad33ff1d080f00ec7 Mon Sep 17 00:00:00 2001 From: Douglas Pessoa Date: Sat, 11 May 2019 21:49:16 +0000 Subject: [PATCH] Document supported headers (#177) --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index 8ad6869..2d1f425 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,33 @@ $ curl https://transfer.sh/1lDau/test.txt|gpg -o- > /tmp/hello.txt $ curl -X PUT --upload-file nhgbhhj https://transfer.sh/test.txt/virustotal ``` +### Deleting +```bash +$ curl -X DELETE +``` + +## Request Headers + +### Max-Downloads +```bash +$ curl --upload-file ./hello.txt https://transfer.sh/hello.txt -H "Max-Downloads: 1" # Limit the number of downloads +``` + +### Max-Days +```bash +$ curl --upload-file ./hello.txt https://transfer.sh/hello.txt -H "Max-Days: 1" # Set the number of days before deletion +``` + +## Response Headers + +### X-Url-Delete + +The URL used to request the deletion of a file. Returned as a response header. +```bash +curl -sD - --upload-file ./hello https://transfer.sh/hello.txt | grep 'X-Url-Delete' +X-Url-Delete: https://transfer.sh/hello.txt/BAYh0/hello.txt/PDw0NHPcqU +``` + ## Add alias to .bashrc or .zshrc ### Using curl