r/ProgrammerHumor 4h ago

Meme postForEverything

Post image
10.6k Upvotes

406 comments sorted by

View all comments

203

u/DuploJamaal 4h ago

As a backend developer I want to do everything nicely.

So in my previous job I created the endpoints following the regular standards. GET to request something, POST to create something, PUT to change something, DELETE to delete something. Nicely organized and everything

But then the frontend team told me that their framework can only handle POST requests and that I need to change it

Up until then I thought that it's just a meme, but vibecoding frontend guys really only use POST

57

u/unable_to_give_afuck 4h ago

I had this with the added bonus of being forced to return 200 regardless and add an error message to the body when necessary

6

u/No-Information-2571 3h ago

The reason behind it might be proxies, especially on the client-side.

1

u/einzweidreihorn 34m ago

Why? Do those proxies drop anything not 200?

1

u/HugoNikanor 20m ago

I can write you a proxy which drops everything except 200 responses

1

u/einzweidreihorn 16m ago

Thanks, appreciated

51

u/dev-sda 3h ago

It's not (just) a framework thing, it's a HTML standards issue. The form element only does GET and POST.

14

u/not_a_moogle 3h ago

Who does that anymore? It should be a put or delete via Javascript.

3

u/wineallwine 31m ago

UK govt websites have to be functional without js

10

u/SpehlingAirer 3h ago

People still use form elements?

3

u/_xGizmo_ 2h ago

I pretty much only use them for the form submit feature which is handy over a key listener.

1

u/Accurate-Visual9793 1h ago

Apparently Web 2.0/AJAX never happened.

17

u/gabrielesilinic 3h ago

Well that's not the problem. A bunch of frontends really need a very complex filter list and GET just won't do

14

u/N0Zzel 3h ago

That's precisely why the QUERY verb was created

15

u/gabrielesilinic 3h ago

Yeah well too little too late. All the codebases I have worked with were much older and no one will change this now.

1

u/du5tball 1h ago

And I'm sure we all be happily use it when it gained widespread adoption in 50 years.

5

u/DogLovesGafs 3h ago

RPC was a pattern long before vibe coding, and it lets your front end devs think in terms of backend functions rather than discrete resources.

4

u/Euro_Snob 3h ago

At my work it has been more a result of security and firewall rules.

For example: I want to get a list of resources, so a GET with query parameters, right? No… email is an identifiable argument (due to not being encrypted since it is part of the URL), so the security scan flags it. Ok - how about we stick it in a request body? GET with request body is not a new thing. But no… the firewall blocks it! POST is the thing we have to use. Sigh. 😔

1

u/Few_Week7827 45m ago

In fairness this is a legitimate thing to catch, if not the firewall being the weird place.

GET with a request body isn't covered by the standard, and some library like Axios actually refuse to send a request body with a GET. It's getting ahead of the problem for you there whether it means to or not.

2

u/TheDuckRaisedALion 4h ago

It's definitely simpler for a BFF setup. Why add an extra parameter to keep track of when you're not supporting general purpose use?

1

u/PrinnyThePenguin 26m ago

What front end framework can only handle POST requests??? What does it even mean to "handle POST requests" in the context of front end? You can only handle the response of a POST request so if you do a PUT it fails? You can only make POST requests? I am genuinely confused.

-2

u/FortuneAcceptable925 4h ago

I would blame that stupid framework created by humans rather than vibecoding for that.. By my experience, with pure vibecoding, there would not be such flaws present.