szabodanika / microbin

A secure, configurable file-sharing and URL shortening web app written in Rust.
https://microbin.eu
BSD 3-Clause "New" or "Revised" License
2.65k stars 163 forks source link

curl example doesn't work because /create path returns 404 #24

Closed maxiimilian closed 2 years ago

maxiimilian commented 2 years ago

Hi,

thanks for your great piece of software! I just faced a small bug. I wanted to write a small script to create pastas from stdin in the terminal and for that I wanted to use curl. More specifically, I wanted to follow this example from microbin's help page:

Simple text Pasta: curl -d "expiration=10min&content=This is a test pasta" -X POST https://microbin.myserver.com/create

However, it seems that the /create endpoint is not existing. I just get HTTP 404 as response. Am I doing something wrong or is this maybe a bug?

Cheers

szabodanika commented 2 years ago

Hi @maxiimilian, thanks for your Issue! You are right, the example in the documentation is outdated. A working example that I just tested would be: curl -v -F expiration=10min -F content="This is a test!" https://microbin.myserver.com/upload/ The request for creating pastas are now multipart request to allow including files (e.g. photos, zips etc), and moved to the /upload/ endpoint (not sure why I did that).

Note to myself: @szabodanika update readme, wiki and help page

maxiimilian commented 2 years ago

Thanks for your quick reply. I've created this little script which takes input from standard input, creates a pasta, and returns the full URL to standard out. This way I can share files very quickly between devices. However, my approach is pretty quick-and-dirty so it only accepts text input and fails when the file gets to 1000+ lines.

foosel commented 1 year ago

@szabodanika as someone who was just got bit by this myself, I'd love to have sent you a PR that takes care of fixing the documentation issue, alas, I don't seem to be able to find the source of microbin.eu. Is there anything the community can do to help get the docs fixed? :)

szabodanika commented 1 year ago

fixed in https://github.com/szabodanika/microbin.eu/commit/83138a776611eb4a702001c8eb50ec78d5cb5f06

For future reference, the source code for microbin.eu is also public: https://github.com/szabodanika/microbin.eu

Carunga commented 11 months ago

fixed in https://github.com/szabodanika/microbin.eu/commit/83138a776611eb4a702001c8eb50ec78d5cb5f06

For future reference, the source code for microbin.eu is also public: https://github.com/szabodanika/microbin.eu

Run into the same issue. Great work btw, I love microbin. The docs are still not uptodate. The links above do not work so I couldn't find a way to help update the docs.