@@ -152,14 +152,16 @@ run-time behavior:
152152
153153### API endpoints
154154
155- POST a new paste to the ` / ` endpoint with the following JSON payload:
155+ POST a new paste to the ` /api ` endpoint with the following JSON payload:
156156
157157```
158158{
159159 "text": "<paste content>",
160160 "extension": "<file extension, optional>",
161+ "title": "<paste title, optional>",
161162 "expires": <number of seconds from now, optional>,
162- "burn_after_reading": <true/false, optional>
163+ "burn_after_reading": <true/false, optional>,
164+ "password": <password for encryption optional>,
163165}
164166```
165167
@@ -194,7 +196,7 @@ line using `xclip`, `curl` and `jq`. Define the following function in your
194196function paste_from_clipboard() {
195197 local URL=$( \
196198 jq -n --arg t " $( xclip -selection clipboard -o) " ' {text: $t}' | \
197- curl -s -H ' Content-Type: application/json' --data-binary @- https://wastebin.tld | \
199+ curl -s -H ' Content-Type: application/json' --data-binary @- https://wastebin.tld/api | \
198200 jq -r ' . | "https://wastebin.tld\(.path)"' )
199201
200202 xdg-open $URL
@@ -208,7 +210,7 @@ To paste from stdin use the following function in your `.bashrc`:
208210``` bash
209211function paste_from_stdin() {
210212 jq -Rns ' {text: inputs}' | \
211- curl -s -H ' Content-Type: application/json' --data-binary @- https://wastebin.tld | \
213+ curl -s -H ' Content-Type: application/json' --data-binary @- https://wastebin.tld/api | \
212214 jq -r ' . | "wastebin.tld\(.path)"'
213215}
214216```
0 commit comments