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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T14:20:37+00:00 2026-06-08T14:20:37+00:00

Here is my configuration and code . public class DeployLogController : ApiController { //

  • 0

Here is my configuration and code .

public class DeployLogController : ApiController
    {
        // GET /api/DeployLog
        public List<DeployLogModel> Get(Guid deployDetailId, Guid? deployLogId)
        {

            DeployLogService service = DeployLogService.Instance;

            return service.GetNewestDeployLogs(deployDetailId, deployLogId).ToList();

        }

        // POST /api/DeployLog
        public void Post(DeployLogModel deployLogModel)
        {
            DeployLogService service = DeployLogService.Instance;
            service.SavaDeployLogByServer(deployLogModel);
        }

    }

and the code of Application_Start in Global.asax.cs is below.

public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
            );

            routes.MapRoute(
               name: "Default",
               url: "{controller}/{action}/{id}",
               defaults: new { controller = "Login", action = "Login", id = UrlParameter.Optional }
           );

        }

        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterGlobalFilters(GlobalFilters.Filters);
            RegisterRoutes(RouteTable.Routes);

            BundleTable.Bundles.RegisterTemplateBundles();
            Configure(GlobalConfiguration.Configuration);

        }

Why did I got 400 Http Response message When I accessed the Url “http://localhost:8119/api/DeployLog&#8221;. Seems the code

routes.MapHttpRoute(
                    name: "DefaultApi",
                    routeTemplate: "api/{controller}/{id}",
                    defaults: new { id = RouteParameter.Optional }
                );

doesn’t work.Did I miss something ? please help me . Thanks.

  • 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-08T14:20:38+00:00Added an answer on June 8, 2026 at 2:20 pm

    Use Phil Haack’s Routing Debugger to determine if the correct route is being hit.

    It looks like you’re either hitting the wrong route, or your route does not have a controller method that corresponds with it (at first glance, it appears that your setup is expecting a controller method called GET, not DeployLog.

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

Sidebar

Related Questions

I simply can not get Visual Studio 2005 to find the System.Configuration.ConfigurationManager class. Here
Here is the approx. code I am working with. public class Note { public
Here's the view: @if (stream.StreamSourceId == 1) { <img class=source src=@Url.Content(~/Public/assets/images/own3dlogo.png) alt= /> }
I am creating database tables by the following code: public void createSchema() { Configuration
Here is my problem. I have a bunch of Configuration classes that get serialized
Here is my service layer: @Service @RemoteProxy public class ReturnToDWR{ @Autowired private DAOLayer daoLayer;
I'm using EF 4.1 code first. Given the following class snippet: public class Doctor
Here's the problem. I would like to create a class which will contain configuration
I've created some web services using CXF and code-firts approach. Here is my configuration
Below is the my complete code Here is cfg file <hibernate-configuration> <session-factory> <!-- Database

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.