Error :No HTTP resource was found that matches the request URI 'http://localhost/api/test'
up vote
0
down vote
favorite
I have a webapi project with a base ApiController named TestController:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using TestDataAcess;
namespace Test2.Controllers
{
public class TestController : ApiController
{
public IEnumerable<table> Get()
{
using (Test_Raw_DataEntities entities = new Test_Raw_DataEntities())
{
return entities.table.ToList();
}
}
public table Get(int ID)
{
using (Test_Raw_DataEntities entities = new Test_Raw_DataEntities())
{
return entities.table.FirstOrDefault(e => e.id==ID);
}
}
}
}
The problem is when I try to go to the URL, it generates the following message:
Error :
No type was found that matches the controller named 'table' and no
HTTP resource was found that matches the request URI
'http://localhost/api/test'
c# .net asp.net-web-api asp.net-web-api-routing
add a comment |
up vote
0
down vote
favorite
I have a webapi project with a base ApiController named TestController:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using TestDataAcess;
namespace Test2.Controllers
{
public class TestController : ApiController
{
public IEnumerable<table> Get()
{
using (Test_Raw_DataEntities entities = new Test_Raw_DataEntities())
{
return entities.table.ToList();
}
}
public table Get(int ID)
{
using (Test_Raw_DataEntities entities = new Test_Raw_DataEntities())
{
return entities.table.FirstOrDefault(e => e.id==ID);
}
}
}
}
The problem is when I try to go to the URL, it generates the following message:
Error :
No type was found that matches the controller named 'table' and no
HTTP resource was found that matches the request URI
'http://localhost/api/test'
c# .net asp.net-web-api asp.net-web-api-routing
1
The urlhttp://localhost/api/tableshould behttp://localhost/api/test
– Izzy
Nov 7 at 9:12
Do you host your application on port 80?
– Marcus Höglund
Nov 7 at 9:19
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a webapi project with a base ApiController named TestController:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using TestDataAcess;
namespace Test2.Controllers
{
public class TestController : ApiController
{
public IEnumerable<table> Get()
{
using (Test_Raw_DataEntities entities = new Test_Raw_DataEntities())
{
return entities.table.ToList();
}
}
public table Get(int ID)
{
using (Test_Raw_DataEntities entities = new Test_Raw_DataEntities())
{
return entities.table.FirstOrDefault(e => e.id==ID);
}
}
}
}
The problem is when I try to go to the URL, it generates the following message:
Error :
No type was found that matches the controller named 'table' and no
HTTP resource was found that matches the request URI
'http://localhost/api/test'
c# .net asp.net-web-api asp.net-web-api-routing
I have a webapi project with a base ApiController named TestController:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using TestDataAcess;
namespace Test2.Controllers
{
public class TestController : ApiController
{
public IEnumerable<table> Get()
{
using (Test_Raw_DataEntities entities = new Test_Raw_DataEntities())
{
return entities.table.ToList();
}
}
public table Get(int ID)
{
using (Test_Raw_DataEntities entities = new Test_Raw_DataEntities())
{
return entities.table.FirstOrDefault(e => e.id==ID);
}
}
}
}
The problem is when I try to go to the URL, it generates the following message:
Error :
No type was found that matches the controller named 'table' and no
HTTP resource was found that matches the request URI
'http://localhost/api/test'
c# .net asp.net-web-api asp.net-web-api-routing
c# .net asp.net-web-api asp.net-web-api-routing
edited Nov 7 at 9:55
grrigore
566420
566420
asked Nov 7 at 9:11
user10617332
11
11
1
The urlhttp://localhost/api/tableshould behttp://localhost/api/test
– Izzy
Nov 7 at 9:12
Do you host your application on port 80?
– Marcus Höglund
Nov 7 at 9:19
add a comment |
1
The urlhttp://localhost/api/tableshould behttp://localhost/api/test
– Izzy
Nov 7 at 9:12
Do you host your application on port 80?
– Marcus Höglund
Nov 7 at 9:19
1
1
The url
http://localhost/api/table should be http://localhost/api/test– Izzy
Nov 7 at 9:12
The url
http://localhost/api/table should be http://localhost/api/test– Izzy
Nov 7 at 9:12
Do you host your application on port 80?
– Marcus Höglund
Nov 7 at 9:19
Do you host your application on port 80?
– Marcus Höglund
Nov 7 at 9:19
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53186391%2ferror-no-http-resource-was-found-that-matches-the-request-uri-http-localhost%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
The url
http://localhost/api/tableshould behttp://localhost/api/test– Izzy
Nov 7 at 9:12
Do you host your application on port 80?
– Marcus Höglund
Nov 7 at 9:19