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

  • Home
  • SEARCH
  • 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 3610962
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:49:03+00:00 2026-05-18T21:49:03+00:00

I have the following URI: Posts/{postId}/Comments/{commentId} I would like to enable users to edit

  • 0

I have the following URI: Posts/{postId}/Comments/{commentId}
I would like to enable users to edit a comment through my API, should the edit be done with POST or PUT?
One one hand, POST updates the contents of a resource so that makes sense but on the other hand PUT replaces it with a new one. So if I understand correctly with POST I need to send only what needs to be updates and with PUT I send the whole resource.
Usually in edit forms, the whole resource is loaded anyway so what’s the point of using POST?
If I take one approach or the other, what are the differences?

  • 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-18T21:49:04+00:00Added an answer on May 18, 2026 at 9:49 pm

    From what I have read (in RESTful Web Services, published by O’Reilly), it seems clear that you should use PUT to update an existing comment.

    • PUT is meant to be used for updating as well as creating a resource.

    • POST can also be used for creating a resource. The difference here is that when POSTing, you don’t need to know the exact URI of the resource to be created. (The service will report the new resource’s URI in its response.)

    • POST is appropriate for partial updates, or when appending information to a resource; PUT is appropriate for a full update (replacement) of a resource.

    • When updating, you can send partial updates, but you should make sure that these are idempotent; ie. if you send the same update more than once, the update will always have the same effect. Don’t send an update such as “Increase n by 1″; instead, send an update such as “Set n to 5.”

    Thus, my suggestion for your case are as follows:

    • Use POST to /Posts/{postId}/Comments to create a new comment, since the client doesn’t know the {commentId} in advance.

    • Use PUT /Posts/{postId}/Comments/{commentId} to completely update a comment (or perhaps POST when appending text to it).

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

Sidebar

Related Questions

I have the following rewrite logic in my vHost and everything seems to be
I have the following scenario: URL u1 = new URL(http://www.yahoo.com/); URL u2 = new
I have the following virtuslhost for my subversion repository and i want to create
In my Facebook Canvas application i have the following problem: The Facebook application is
I am getting the following error while setting up the load balancer with two
I have recently starting porting a small app of mine to Facebook as a
I have a method that generates XML for a class I have created -getXML().
I recently started to use LINQ to SQL and i have a minor complex
I am trying to improve the performance of a Silverlight 4 WCF RIA application.
Some time ago we needed a solution for Single Sign On authentication between multiple

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.