Skip to content

Paste a file with plain curl (any file type) - #52

Merged
ralyodio merged 1 commit into
mainfrom
worktree-paste-curl-file
Oct 23, 2026
Merged

ralyodio merged 1 commit into
mainfrom
worktree-paste-curl-file

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

The /paste page had no plain curl example for a file, only a jq recipe, because the API took JSON only.

  • POST /api/v1/pastes now also accepts a multipart upload (curl -F file=@app.log, file name becomes the title and picks the language) or raw bytes (--data-binary @app.log with ?title=&expiresIn=&language=).
  • PDFs/images are base64'd server side; all other files are read as UTF-8 text.
  • /paste curl block now leads with these examples; API block documents them.
  • Tests: new upload/raw/PDF case; bun test ./server/test 97 pass; typecheck clean; smoke-tested with real curl against a local server.

🤖 Generated with Claude Code

POST /api/v1/pastes now takes the file itself as well as JSON:
curl -F file=@app.log uses the upload's name as the title (so the
extension picks the language), and --data-binary takes title,
expiresIn and language from the query string. PDFs and images are
base64'd server side as the JSON form expects. The /paste page leads
its curl block with these instead of the jq recipe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ralyodio
ralyodio merged commit 6e3d448 into main Oct 23, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant