my logout route for my web app uses a get request, i want to change it to a post. what's the post way to post to a route from a web page, just make a form with nothing but a submit button?
@haskal until people start blocking that for similar reasons. god i fucking hate the frontend web. everything should just be a fucking REST api so i can do whatever i want lmao
@simula absolutely! i'm not saying _you_ should disable js in your browser, just that it's not great to _make_ one of those sites that breaks when js is off lol
@tindall oh definitely. unfortunately, making a decent interactive site that works with and without js is awful
@wxcafe lol dw
i disagree with you quite a bit on a few things, but you've always been super nice about our disagreements c:
i think everyone has a ton of bad ideas tbh
@simula From MDN: "ping: A space-separated list of URLs. When the link is followed, the browser will send POST requests with the body PING to the URLs. Typically for tracking."
oh i hate this soooooooo much lmao
there's an issue though. the reason to use POST in this situation is to avoid issues caused by browser prefetching. when a browser prefetches a link or a crawler hits that a tag, will it still send the ping?
@simula I haven't used it in practice so I don't actually know, but my gut tells me that shouldn't be the case.
Also, this is just me spitballing, but if that's the problem you're trying to avoid, shouldn't just not putting the link to the logout page in the document unless you're signed in be satisfactory? If not, would making the user id part of the logout link and then just ignoring it once it hits backend work?
@amandag still an issue with browser prefetching
i do my best to make sure user ids are *never* transported to any part of the frontend. that's a data leak i Do Not Want lmao
honestly it's probably best to just use css to style the button.
Cybrespace is an instance of Mastodon, a social network based on open web protocols and free, open-source software. It is decentralized like e-mail.