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 8925573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:44:04+00:00 2026-06-15T07:44:04+00:00

So I want to know what are the best practices for doing actions on

  • 0

So I want to know what are the best practices for doing actions on a object that doesn’t change the state of the object. If that doesn’t make sense bear with me, I think the tweet example explains what I am trying to say.

I understand the basics like described here:

What are the best/common RESTful url verbs and actions?

And how it works when updating/getting/deleting etc an object. But what about actions that don’t change the state of the object?

For example say we have a tweet object:

GET     `/tweets  (gets a list of tweets)
GET     `/tweets/new (gets a new page to create a new tweet)
POST    `/tweets (posts data to server to create new tweet)
GET     `/tweets/:id (get a single tweet)
GET    `/tweets/:id/edit (get a page to edit an exisiting tweet)
PUT    `/tweets/:id (put data to server to edit exisiting tweet)
Delete `/tweets/:id (delete an exisiting tweet)

This makes sense to me. But how do i form the URL for reply/ follow / retweet/ favorite, some of which don’t actually change the state of the tweet?

Should I do something like below?

POST   `/tweets/:id/reply       (post the reply message to the server)
POST    `/tweets/:id/follow     (post a boolean? yes I follow?)
POST    `/tweets/:id/retweet    (again post a boolean?)
POST    `/tweets/:id/favorite   (ditto)

Or do a

POST     `/tweet/:id/actions  (Do a post with the action I want to take as a parameter)

Or is there no “standard way”.
Anyways thanks for the help!

  • 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-06-15T07:44:06+00:00Added an answer on June 15, 2026 at 7:44 am

    Great question.

    As always, it helps to switch the framing to nouns instead of verbs. What are the resources you’re acting upon when you reply/etc.? And can those resources be fetched/addressed also?

    In each of the cases you mentioned, I think the answer to the second question is yes. And in fact, Facebook’s Graph API and GitHub’s REST API both follow this approach.

    E.g. for replying:

    • GET /tweets/:id/replies to get a list of tweets that were in reply to the given one

    • POST /tweets/:id/replies to create a new tweet in reply to the given one. The important part here is that success is a 201 Created w/ the Location header set to the created tweet’s endpoint, e.g. /tweets/1234.

    • (Deleting a reply is then just deleting a tweet.)

    Following/retweeting/favoriting are a bit trickier because the “nouns” are lightweight connections, and in fact, I just asked a Stack Overflow question for the “best” way to expose those:

    RESTful API design: best way to CRUD lightweight connections?

    You can see on that thread the specific way(s) you might implement following/retweeting/favoriting.

    Hope this helps!

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

Sidebar

Related Questions

I want to know about the best practices here. Suppose I want to get
Here's the method. I want to know if I am violating any best practices
I want to know the best practices followed to share a queue (resource) between
I'm working on updating a project and I just want to know best practices
I'm creating a javascript object, and I want to know the best practice in
I want to know what the best practice is for passing values (sometimes multiple
I am developing an android app and I want to know the best way
I've been at this for a while and want to know the best way
Basically, I want to know what is best to avoid future problems and confusions
i want to know which parsing method is best to use among Simple XML

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.