Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Java Spring with Hibernate File Uploads and Entity Updates in Spring + Hibernate Updating Categories: Part 2

Brendan Whiting
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Brendan Whiting
Front End Web Development Techdegree Graduate 84,702 Points

Should the HTTP method be ‘put’ for editing a category?

Just curious about when we use the other HTTP methods. It seems to be always POST or GET. I thought PUT was for updating a resource, which is what we seemed to be doing. Do some people just stick with POST and GET 100% of the time?

2 Answers

stjarnan
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
stjarnan
Front End Web Development Techdegree Graduate 56,488 Points

Hi Brendan! I'm not sure if some people just stick to GET and POST, it's possible I suppose. But to answer your question, if you want to edit and replace something, PUT is what you want.

Here is a link if you would like to read more: http://www.restapitutorial.com/lessons/httpmethods.html

J llama
J llama
12,629 Points

what a horrible tutorial lol has us not using put for editing db data