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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:54:28+00:00 2026-06-10T00:54:28+00:00

Why using MapRoute for Default routing, while using MapHttpRoute for DefaultApi routing? routes.MapHttpRoute( name:

  • 0

Why using “MapRoute” for “Default” routing, while using “MapHttpRoute” for “DefaultApi” routing?

routes.MapHttpRoute(
  name: "DefaultApi",
  routeTemplate: "api/{controller}/{action}"
);

routes.MapRoute(
  name: "Default",
  url: "{controller}/{action}/{id}",
  defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
  • 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-10T00:54:30+00:00Added an answer on June 10, 2026 at 12:54 am

    If you use Web API on top of ASP.NET they would ultimately both operate on the same underlying ASP.NET route table – however as correctly pointed out, from the user perspective you call two different methods to register route.

    Routing was designed like this so that when hosting outside of ASP.NET, Web API wouldn’t have to rely on System.Web.

    Bear in mind that Web API is not sitting on top of MVC, Web Forms, or, for that matter ASP.NET at all. It can be hosted within web context (ASP.NET) but can also be self hosted (Console, WPF etc) or even hosted in memory (without port use, useful for i.e. lightweight end-to-end testing).

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

Sidebar

Related Questions

Suppose I have the following routing routes.MapRoute( Default, // Route name {controller}/{action}/{id}, // URL
using the default route routes.MapRoute( Admin, // Route name Admin/{action}, // URL with parameters
route : routes.MapRoute(Default, {controller}/{action}/{id}/{args1}/{args2}/{args3}, // URL with parameters new { controller = Home, action
I have the following setup for my application: routes.MapRoute(Default, {controller}/{action}/{idt}, new { controller =
I'm trying to take advantage of the default routing so I get a URL
I would like to write a URL shortener using MVC routing. The thing is
I need to pass a url string from the view to the controller, a
Despite the plethora of URL routing posts, I have yet to reach enlightenment on
Is it possible to make url with custom literal separator that can have default
I am using ASP.NET MVC 4 Beta with Web API - although I believe

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.