Comments (3)
Nice Idea, but why no JSON involved? I mean, you can always use jq for that stuff:
curl -Ls -X POST https://pasty.lus.pm -d @snippet.txt | jq .id
That allows users to use further information like the deletion token. But yeah, than you can also just use the /pastes
endpoint in your script if you really want, I guess. ^^
from pasty.
Yeah, I am also quite unsure about that. It would be just another endpoint to implement and we would end up with 4 different ways of creating endpoints (root URL, hastebin support, API v1 ad API v2). Maybe it's not even that reasonable.
from pasty.
Another approach would be to use the Accept
header. So if you specify application/json
as Accept
header value, you get a fully hydrated JSON response. Otherwise, if you do not specify any Accept
header or if you pass text/plain
, you simply get a Paste URL or ID like you originally supposed. Which one of these is set as default is up to you, but should not differ across the whole API in my opinion in order to maintain consistency.
from pasty.
Related Issues (20)
- Access to clipboard HOT 5
- Weird error when running on systemd HOT 10
- Potentially embed the frontend HOT 1
- Bundle JS dependencies
- Deprecate & remove additional storage drivers HOT 2
- Use Semantic Versioning HOT 2
- Return proper HTTP status for invalid content type HOT 2
- Code execution using ranna
- [Idea] set paste to never expire HOT 1
- Pasty behind Reverse Proxy as Subpath HOT 5
- Line number's position mismatch the content when some lines are wrapped
- FEAT: add view counter to paste footer
- Allow Apple's command key for keybinds
- how to know my modification token? HOT 4
- Custom share codes HOT 3
- Frontend rewrite
- Store admin tokens in database
- Prevent search engine indexing
- Support for arm HOT 5
- Admin API
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pasty.