All Questions
145 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 ...
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()
{
...
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}")]
...
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}")]
[...
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 ...
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
...
1
vote
2
answers
163
views
How to implement a .NET WebAPI with a route of "controller?action¶meters"?
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/...
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: "...
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 ...
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 ...
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 ...
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 ...
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 ...
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 (...
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 ...