-2

I am using Spring Boot for creating rest API. I learnt about PUT, PATCH, POST. PUT is for updating the resource and if Id is not present then it creates. Patch is for updating part of the resource and Post for creating new resources.

What I don't understand is, are they are only standards that helps outside world to let all know what the API is for ? Because I can do the same implementation in Put like Patch and make Put request to perform partial updates.

3
  • 1
    Your wording of the question needs work. Also what does a question regarding the purpose of HTTP methods have to do with Spring Boot? Commented Jun 22, 2023 at 13:58
  • I just wonder how a user with over 30k rep and spring-boot tag on more than 50% of their posts could ask this kind of newbie question. Is this some kind of joke? Or are you guys grinding rep this way? Commented Aug 9, 2023 at 17:59
  • @Vasily: users who asked questions on this platform ten years ago can (and have) achieved Trusted User status without any effort or research across the lifetime of their account. I suspect it was not possible back then to predict that the rep system probably needed a per-post rep cap (and I'd be fully in favour of a sitewide rep recalc on that basis). Commented Jan 26, 2024 at 12:09

1 Answer 1

0

HTTP Methods are standard or specification

As you said, you can implement with totally ignoring what standard says, but it means your software/api should be used with concerns(because this don't follow standards), which make integration with others complicated.

For example, old standard says there can't be no body should be sent on GET, and Java developers followed this standard faithfully, errors occurred or were ignored when adding a body to a GET request, which made some developers in trouble who did not followed standard.

Read also: HTTP Methods definitions - RFC 9110

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.