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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:22:02+00:00 2026-05-11T11:22:02+00:00

The standard template for ASP.NET MVC (and MVC in general) seems to be {controller}/{action}/{id}

  • 0

The standard template for ASP.NET MVC (and MVC in general) seems to be {controller}/{action}/{id}, however, on a project i’m currently working on i’m not sure if that is an appropriate structure. If for example I had an application that controlled a car, to me it would make more sense to me to have the structure below:

  {car-rego}/{controller}/{action}/{data etc} 

This makes sense to me because the car (identified by registration plate) is the resource we are performing operations on and the logical separation of functionality is seperated into the controller and action. This would result in URL’s such as:

/ESX-121/Power/On /ESX-121/Speed/Set/100 /ESX-121/Speed/Current -- get the current speed (could be /ESX-121/Speed also) /ESX-121/Turn/Left /ESX-121/Speed/Set/90 /ESX-121/Power/Off 

If this followed the default pattern it would be something like below:

/Power/On/ESX-121 /Speed/Set/ESX-121/100 /Speed/Current/ESX-121 -- get the current speed (could be /Speed/ESX-121 also) /Turn/Left/ESX-121 /Speed/Set/ESX-121/90 /Power/Off/ESX-121 

To me the first option makes it much more sense as far as readable URL’s go and the resource identifier is in a constant logical place. For example /Speed/Set/ESX-121/100 suggests to me that there is a resouce of type speed with an identifier of ESX-121 which is not really the case, the operation is on the car.

How do you go about structuring URL’s and the related controllers and actions for cases such as this? Do you think this is an acceptable solution, or is there a better way for this to be structured?

  • 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-11T11:22:02+00:00Added an answer on May 11, 2026 at 11:22 am

    There is a big problem, from a ‘philosophical’ point of view.

    You seem to be using GET requests for pretty much everything, such as setting speed. The idea behind REST is that access to the ESX-121 resource gives you a representation of its current state, in your case its speed, its direction, if it’s on etc.

    POSTing some representation of the car at its URL will effectively change its current state. (If you are using XML for representation for example, you could post

    <car><id>ESX-121</id><speed>100</speed><car> 

    to change its speed. Under ASP.net MVC you would POST a form for that.

    What you are trying to do is to apply a SOAP service way of modeling (geared towards operations, or verbs) to a REST service, which is not really the idea.

    It can be difficult to ‘get’ the REST way of doing things, and it can go against everything you have been doing i you were using SOAP services, but it is important to keep those principles in mind.

    In theory, you URL describes a resource, and the only operations available are carried out through GET (read), POST (create), PUT (create or update), DELETE (delete).

    EDIT: Thanks to marxidad for correcting me on what each verb should map to.

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

Sidebar

Related Questions

In a standard ASP.NET MVC template application that is created by default in Visual
I have a standard template ASP.NET MVC 2 Web application solution, an empty (meaning
I'm just starting out learning ASP.NET MVC. I'm working on a project created with
I'm looking at creating my first ASP.NET MVC application using MVC3. The project template
I have a standard ASP.NET MVC (RC Refresh) web project, with the standard ASP.NET
I have created an asp.net mvc2 project using the standard visual studio template which
I am developing asp.net MVC 3 application from the standart template, with included AccountController
I'm trying out sharp-architecture (and ASP.NET MVC) for a new project after being on
I installed the MVC 4 beta and created a new project. The standard template
While looking at the unit tests that come with the standard ASP.MVC Web Project

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.