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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:54:40+00:00 2026-06-14T15:54:40+00:00

I’m still very new to web development, so please bear with me if this

  • 0

I’m still very new to web development, so please bear with me if this question is really stupid.

I’m trying to follow a REST principles, however, I really appreciate how JSON flows with Ruby and anything that is connecting externally through an API. I know that its pretty standard in REST to input parameters directly into the URL like so: myurl.com/ExampleModel/MyIDParameter and send the JSON (if there is any) to that URI, right?

What I would like to know is: Is it against REST principles to remove the parameter from the URI (and the routing if I will never use it) and include the parameter in the JSON?

For example, instead of calling this:

myurl.com/ExampleModel/id
{
    "name" : "My Name",
    "anotherParameter" : "A random string"
}

You would call this:

myurl.com/ExampleModel
{
    "id" : 512,
    "name" : "My Name",
    "anotherParameter" : "A random string"
}
  • 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-14T15:54:41+00:00Added an answer on June 14, 2026 at 3:54 pm

    First, Disclaimer: I don’t program in Ruby, so I cant answer specific questions on Ruby. But my answer is directed to your question of REST principles.

    Finally, the answer:
    This is a matter of how your application plays out. I will first explain a common approach used by developers. I mentioned common and is not the golden rule.

    When you specify myurl.com/ExampleModel/id. A common meaning of such a pattern is used in with GET or PUT operation. GET in the sense that I want information on some object of ID value id. PUT in the sense that I have some request body attached with the request to be Updated to the Data Store whose Object have a ID of id.

    Your second URL when you mentioned just myurl.com/ExampleModel, A common interpretation is to show me all the records from the ExampleModel collection. This is pretty much the default behaviour used by developers who write APIs.

    So, does it break REST principles when you want to do things, the answer is NO. But if you hand your API to other people, the might get a bit confused over it.

    So there you have it. Now it’s upto you to decide what is best suited for your application.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
this is what i have right now Drawing an RSS feed into the php,

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.