[GH-ISSUE #122] Questions on how to send POST requests to the api #77

Closed
opened 2026-02-27 10:15:37 +03:00 by kerem · 6 comments
Owner

Originally created by @back-lacking on GitHub (Feb 19, 2025).
Original GitHub issue: https://github.com/matze/wastebin/issues/122

So I have an instance of wastebin that I have setup in my homelab and would like to use it as a place to post logs for some of the automated tasks i run. However, I'm having some trouble with sending a post request up to the API. (I'm a beginner to sending requests and interacting with APIs so some stuff might not be obvious to me).
Here is the curl command that i am running to test some stuff out

curl "https://wastebin.local.domain/api/" -X POST -s -H 'Content-Type: application/json' -d '{"title":"test paste","text":"test text","expires":"604800"}'

running this command returns nothing, and i dont get an output that is similar to what is shown in the docs

Is there something im missing? please let me know

Originally created by @back-lacking on GitHub (Feb 19, 2025). Original GitHub issue: https://github.com/matze/wastebin/issues/122 So I have an instance of wastebin that I have setup in my homelab and would like to use it as a place to post logs for some of the automated tasks i run. However, I'm having some trouble with sending a post request up to the API. (I'm a beginner to sending requests and interacting with APIs so some stuff might not be obvious to me). Here is the curl command that i am running to test some stuff out ```bash curl "https://wastebin.local.domain/api/" -X POST -s -H 'Content-Type: application/json' -d '{"title":"test paste","text":"test text","expires":"604800"}' ``` running this command returns nothing, and i dont get an output that is similar to what is shown in [the docs](https://github.com/matze/wastebin?tab=readme-ov-file#api-endpoints) Is there something im missing? please let me know
kerem closed this issue 2026-02-27 10:15:37 +03:00
Author
Owner

@matze commented on GitHub (Feb 19, 2025):

Can you please specify which version you are running?

<!-- gh-comment-id:2669519041 --> @matze commented on GitHub (Feb 19, 2025): Can you please specify which version you are running?
Author
Owner

@matze commented on GitHub (Feb 19, 2025):

Oh, I can reproduce. The trailing / is wrong.

<!-- gh-comment-id:2669528643 --> @matze commented on GitHub (Feb 19, 2025): Oh, I can reproduce. The trailing `/` is wrong.
Author
Owner

@back-lacking commented on GitHub (Feb 19, 2025):

Image
this is what happens when i do it wihtout the trailing /

<!-- gh-comment-id:2669890307 --> @back-lacking commented on GitHub (Feb 19, 2025): ![Image](https://github.com/user-attachments/assets/b6503cdb-5cc8-4aa2-87ea-2e09dd2fdd3f) this is what happens when i do it wihtout the trailing /
Author
Owner

@matze commented on GitHub (Feb 20, 2025):

I still don't know which version you use, the README.md targets the current HEAD repo state. If you use that, it should work. If you use one of the last released versions then it should be / instead of /api.

P.S.: expires must be a number not a string. But you will get an error then anyway.

<!-- gh-comment-id:2670875823 --> @matze commented on GitHub (Feb 20, 2025): I still don't know which version you use, the `README.md` targets the current HEAD repo state. If you use that, it should work. If you use one of the last released versions then it should be `/` instead of `/api`. P.S.: `expires` must be a number not a string. But you will get an error then anyway.
Author
Owner

@back-lacking commented on GitHub (Feb 20, 2025):

how can i see what version im using?
according to docker image ls im using the wastebin docker image on the latest tag, with the id 2ff638790256

<!-- gh-comment-id:2672349199 --> @back-lacking commented on GitHub (Feb 20, 2025): how can i see what version im using? according to `docker image ls` im using the wastebin docker image on the latest tag, with the id `2ff638790256`
Author
Owner

@matze commented on GitHub (Feb 21, 2025):

Yes, the released Docker image is using the "old" route where you have to POST to /. You can find the version in the <head> metadata value generator. I will update the README.md to avoid future confusion.

<!-- gh-comment-id:2673863853 --> @matze commented on GitHub (Feb 21, 2025): Yes, the released Docker image is using the "old" route where you have to `POST` to `/`. You can find the version in the `<head>` metadata value `generator`. I will update the `README.md` to avoid future confusion.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/wastebin-matze#77
No description provided.