Skip to main content

All Questions

0 votes
1 answer
319 views

ASP.NET Web Site Not Allowing Axios PUT Access (405 Method Not Allowed)

I've got a controller set up and working for all of my GET requests, but when it comes to the PUT requests my Web Site (not a Web App, if that makes any difference) is returning a 405. I've got the ...
Scott Baker's user avatar
  • 10.5k
1 vote
0 answers
97 views

C# Web Api 2.1 return 404

I've created a new C# WebApi 2.1 from MVC Empty template and I don't know why, when I create a custom route, it returns 404. Otherwise it works fine. Global.asax protected void Application_Start() { ...
Jonathan Anctil's user avatar
2 votes
1 answer
1k views

Route conflict in ASP.NET WebAPI

I have two different controllers and each one with its configured routes. To explain my problem, I will exemplify: ProdutoController [Route("v1/empresas/{idConexao}/produtos/{id}")] ...
Saulo Pacífico's user avatar
0 votes
1 answer
46 views

.Net Framework API Controller won't recognize Route attributes

I have created an API Controller using .Net Framework as follows: public class ApplicationUsersController : ApiController { [Route("api/ApplicationUser/{username}/{password}")] [...
Jim Wilcox's user avatar
  • 1,583
0 votes
1 answer
331 views

Attribute Based Routing/Versioning in ASP.Net WEB API 2.0

I'm trying to use versioning in Asp.Net Web API. Following is the structure of the project. To support versioning I've added Microsoft.AspNet.WebApi.Versioning NuGet package. Following is the code ...
Vivek Sharma's user avatar
1 vote
1 answer
386 views

ASP.NET WebApi2 OData handling of queries with slash /

I have made a "standard" Web Api 2 OData project with convention model routing. Following OData queries are working: /odata/Users /odata/Users(123) /odata/$metadata /odata/Users?$select=Username ...
dvlpr's user avatar
  • 31
1 vote
2 answers
163 views

How to implement a .NET WebAPI with a route of "controller?action&parameters"?

I'm trying to implement a specific HTTP interface (SAP Content Server HTTP Interface) with .NET Standard WebAPI, that requires that the routes be all in the form of: http://server:port/somepath/...
pap's user avatar
  • 11
0 votes
0 answers
87 views

How can I set HttpPost attribute globally in Web API?

I am working on an existing Web API in which I need to make all actions HttpPost based. For achieving this I am using configuration like this. config.Routes.MapHttpRoute( name: "...
ramanmittal's user avatar
0 votes
0 answers
39 views

Global access to the database does not work

I did the WebAPI and Angular collaboration here - https://angular.io/tutorial but they fill the heroes themselves there. And I need to get the names from my already created database. The request in ...
user avatar
0 votes
1 answer
31 views

How to design multiple ways to invoke REST API

I am using ASP.NET Web API. I want to REST uri to be GET /api/v1/documents/1234/download or GET /api/v1/documents/1234?act=download or GET /api/v1/documents?id=1234&act=download Is it ...
LP13's user avatar
  • 34.4k
0 votes
2 answers
215 views

Routing error: No HTTP resource was found that matches the request URI

I'm trying to make the API call http://localhost:56578/v1/reports to call my GetReports() method. However I continue to get the error message in the subject. I'm following the ms docs here via ...
tshoemake's user avatar
  • 1,351
0 votes
1 answer
7k views

Post request to database associated with primary and foreign key in web api using Entity Framework

I have a database with three tables with primary and foreign key association . I am using Web API and Entity Framework to auto generate methods. I have been successful doing that. But I want to ...
Ayushi Gupta's user avatar
6 votes
2 answers
5k views

Default controller action for Web API in Asp.Net MVC

My Web API on an Asp.Net MVC web app is returning 404 error when receiving requests that don't specify any controller. The calls that are returning 404 error are: https://myWebApp/api/ The goal ...
donquijote's user avatar
  • 1,822
0 votes
1 answer
2k views

Correct way to support multiple authorization attributes on ASP.Net Web API 2

My ASP.Net Web API app created a JWT Token upon successful login. public IHttpActionResult LogOn([FromBody] LoginRequest request) { var result = _service.LogOn(request); if (...
Stubborn's user avatar
  • 330
0 votes
1 answer
41 views

Custom route in Web Api 2 to call with angular app

So I have Web Api 2 set up and and doing my restful calls from Angular 5. I have a custom route that I would like to call but keep receiving a 400 error. Can someone shed a bit of light. Thanks. Web ...
jpavlov's user avatar
  • 2,261

15 30 50 per page
1
2 3 4 5
10