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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:28:16+00:00 2026-05-11T07:28:16+00:00

In my continuing quest to try and wrap my mind around RESTful-ness, I’ve come

  • 0

In my continuing quest to try and wrap my mind around RESTful-ness, I’ve come to another place where I’m not sure how to proceed. I set up a thought expiriment for myself where I’d design a simple voting system for a resource, much like how SO allows voting on questions. So, say my resource is an image, and I can get an image by an ID, like so:

http://www.mysite.com/images/123123 

And in this example, that returns say, a JSON representation of an image, like so:

{ 'URL':'http://www.mysite.com/images/123123.jpg', 'Rep':'100' } 

How would I design a way to ‘vote’ on that image? I’d like two operations; up-vote and down-vote. The client shouldn’t know how much weight each carries, because I’d like to have the award for an up-vote/down-vote be decided at the server level so I can change it anytime I like.

My first idea was to have something like this:

http://www.mysite.com/vote/images?image=123123 

To that URL, one could POST something like the following:

{ 'Vote':'UpVote' } 

But I’m wary of that – to me that says RPC in disguise. Would that be a poor way to design this? If so, what other designs could I try?

  • 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. 2026-05-11T07:28:17+00:00Added an answer on May 11, 2026 at 7:28 am

    To be restful you should return something like this

    { 'URL':'http://www.mysite.com/images/123123.jpg', 'Rep':'100' 'UpVoteLink':'http://blah, blah, blah', 'DownVoteLink':'http://blah, blah, something else blah', } 

    As far as REST is concerned it doesn’t matter what the format of the links are. As long as your client knows that it is supposed to do POST to the ‘UpVoteLink’ or ‘DownVoteLink’ it couldn’t care less what the format of the URL is.

    Also, if you decide in two weeks that you don’t like the URLs you picked, you can change them and no-one will care!

    Ok, ok, if you really want a suggestion for an url design, how about

    POST http://www.mysite.com/UpVotes?url=http://www.mysite.com/images/1234.jpg  POST http://www.mysite.com/DownVotes?url=http://www.mysite.com/images/1234.jpg 

    What is cool about this design is that you could vote on images that are not even on your site!

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

Sidebar

Ask A Question

Stats

  • Questions 58k
  • Answers 58k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer You dont want to build a new table for each… May 11, 2026 at 8:50 am
  • added an answer The localization situation is not ideal. Although Cocoa UI elements… May 11, 2026 at 8:50 am
  • added an answer Use the System.Net.WebClient class. System.Console.WriteLine(new System.Net.WebClient().DownloadString(url)); May 11, 2026 at 8:50 am

Top Members

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

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.