Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4325106
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:13:22+00:00 2026-05-21T09:13:22+00:00

According to REST style, it’s generally assumed that HTTP POST, GET, PUT, and DELETE

  • 0

According to REST style, it’s generally assumed that HTTP POST, GET, PUT, and DELETE methods should be used for CREATE, READ, UPDATE and DELETE (CRUD) operations.

But if we stick to the HTTP method definitions, it might not be so clear.

In this article it’s explained that:

In a nutshell: use PUT if and only if you know both the URL where the resource will live, and the entirety of the contents of the resource. Otherwise, use POST.

Mainly because

PUT is a much more restrictive verb. It takes a complete resource and stores it at the given URL. If there was a resource there previously, it is replaced; if not, a new one is created. These properties support idempotence, which a naive create or update operation might not. I suspect this may be why PUT is defined the way it is; it’s an idempotent operation which allows the client to send information to the server.

In my case I usually issue updates passing all the resource data, so I could use PUT for updates, but every time I issue an update I save a LastUser and LastUpdate column, with the user id that made the modification and the time of the operation.

I’d like to know your opinion, because strictly speaking those two columns are not part of the resource, but they do prevent the operation from being idempotent.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T09:13:22+00:00Added an answer on May 21, 2026 at 9:13 am

    Ignoring the comment about the REST style mapping CRUD to the HTTP methods, this is an excellent question.

    The answer to your question is, yes you are free to use PUT in this scenario even though there are some elements of the resource that are updated by the server in a non-idempotent manner. Unfortunately, the reasoning behind the answer is quite vague. The important thing, is to understand what was the intent of the client request. The client intended to completely replace the contents of resource with the values passed. The client is not responsible for the server doing other operations and therefore the semantics of the HTTP method are not violated.

    This is the reasoning that is used to allow a server to update a page counter when you do a GET operation. The client didn’t ask for an update therefore the GET is safe even though the server chose to make an update.

    The whole, complete resource versus partial resource debate has finally been spelled out in an update to the HTTP spec

    An origin server SHOULD reject any PUT
    request that contains a
    Content-Range header field, since it
    might be misinterpreted as partial
    content (or might be partial content
    that is being mistakenly PUT as a
    full representation). Partial content
    updates are possible by targeting a
    separately identified resource with
    state that overlaps a portion of
    the larger resource, or by using a
    different method that has been
    specifically defined for partial
    updates (for example, the PATCH
    method defined in [RFC5789]).

    So, what we are supposed to do is now clear. What is not so clear is why there exists this constraint on only being allowed to send full responses. That question has been asked and IMHO remains unanswered in this thread on rest-discuss.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According to REST philosophy, a PUT operation should create an entity if it doesn't
According to the REST philosophy, a PUT request should update the resource at a
According to the REST ideology what should be in the response body for a
In my UITableView, I have a tableHeaderView that should resize itself according to the
According to this discussion , the iphone agreement says that it doesn't allow loading
According to Wikipedia, on the Comparison of programming languages page, it says that F#
I'm trying to put some (vertically-stacked) display:block elements within a display:inline-block element. According to
I am developing an app for android mobiles that communicates with a json/rest web
I'm adding an API to a Symfony-application which should act as a REST web-service.
First of all I'm working based on the following assumption: according to the REST

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.