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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:04:27+00:00 2026-06-10T05:04:27+00:00

I am supposed to make web services for an app and thought I could

  • 0

I am supposed to make web services for an app and thought I could do a nice job practicing the good practice. As I found out it’s using REST. But there is one thing that makes very little sense in it.

Why use URI to pass any variable?

What we did in our last project is use POST only and pass whatever as raw POST data (which was JSON). That’s not very RESTful. But it has some advantages. It was quite simple on the client side – I had a general function that takes URI and data as arguments and then it wraps it up and sends it.

Now, if I used proper REST, I would have to pass some data as part of the URI (user ID, for instance). All the other data (username, email and etc.) would have to go as raw data, like we did, I guess. That means I would have to separate user ID and the other data at some point. That’s not so bad but still – why?

EDIT
Here is a more detailed example:

Let’s say you want to access (GET) and update (POST) user data. You may have a service accessible under /user but what RESTful service would do is accept user’s ID as part of the URI (/user/1234). All the other data (name, email and etc) would go to request content (probably as JSON).

What I pose is that it seems useless to make put user id in the URI. If you wanted to update user data – you would send additional data as content anyway. If you wanted to access it – you could use same generic method to request web service.

I know GET gets cached by a browser but I believe you have to cache it manually anyway if you use AJAX (web) or any HTTP client library (other platforms).

From point of scalability – you can always add more services.

  • 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-10T05:04:28+00:00Added an answer on June 10, 2026 at 5:04 am

    You use the URI to identify the resource (user/document/webpage) you want to work with, and pass the related data inside the request.

    It has the advantage that web infrastructure components can find out the location of the resource without having any idea how your content is represented. For example, you can use standard caches and load balancers, all they need to know is the URL and headers (which are always represented the same way) Whether you use JSON, protobuf or WAV audio to communicate with your resource is irrelevant.

    This will for example let you keep different resources in totally different places, if you send it all as content you won’t have the advantage of being able to place the resources in totally different locations, as for example http://cloud.google.com/resource1 and http://cloud.amazon.com/resource2.

    All this will allow you to scale massively, which you won’t be able to do if you put it all on http://my.url.com/rest and pass all resource info as content.

    Re: Your edit

    Passing the user id in the URL is the only way to identify the individual resource (user). Remember, it’s the user that’s the resource, not the “user store”.

    For example, a cache that caches http://my.url/user won’t be much good, since it would return the same cached page for every user. If the cache can work with http://my.url/user/4711, it can cache every user separately. In the same way, a load balancer could know that users 1-5000 are handled by one machine, 5001-10000 by another etc. and make intelligent decisions based on the URL only.

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

Sidebar

Related Questions

I'm using Google App Engine and python for a web service. Some of the
I am developing a web app that is supposed to have the feeling of
So I'm using Spring Web Flow on a project and want to make use
I have a silverlight library that is supposed to get make a web service
I´ve been working with on a Asp.NET web app using jQuery to generate a
I followed this NetBeans guide here on RESTful web services using JPA - http://netbeans.org/kb/docs/websvc/rest.html
Suppose I want to make a Web application which uses a fixed width and
I supposed to make this type of charts, is it posssible to make through
So I am supposed to make 3 classes and am given a 4th class
The following code is supposed to make the right 60% of the display red.

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.