You can read the ref and take a look in the Difference between ApiController and Controller in ASP.NET MVC, since people are commonly confused with them.
Questions tagged [asp.net-apicontroller]
456 questions
-1
votes
1 answer
ASP.NET API Controller method custom route - Include current URL
I am trying to create a custom route for an API Controller, that has the following structure:
/{currentUrl}/{methodName}
currentUrl does not come as a parameter.
Example:
/tool/compute/download
where "download" is the name of the method, and…

Marius Popa
- 564
- 1
- 5
- 22
-1
votes
1 answer
Asp.net single page application: How to examine post data? which property of the Request object?
How do I examine the post data submitted through Ajax request? Is it in the Request object? if yes, which property? Thanks!

Alan Zeng
- 74
- 1
- 7
-2
votes
2 answers
I want to pass very long string as parameter in Asp .net core web api POST method?
I want to pass very long string as parameter in Asp .net core web api POST method, but when I am passing that it takes only starting few words. How to resolve this issue?
The data I'm passing:
{
"Stack":" RtrnAddr Arg#1 Arg#2…

ashwini patil
- 7
- 1
- 6
-2
votes
1 answer
How can I correctly retrieve the request JSON payload inside this .NET controller method?
I have this controller method handling a POST request:
[SharePointContextWebAPIFilter]
[HttpPost]
[ActionName("InviaMailAlProtocollo")]
public IHttpActionResult InviaMailAlProtocollo(string siglaIdUor)
{
Console.WriteLine("INTO…

AndreaNobili
- 40,955
- 107
- 324
- 596
-2
votes
1 answer
Requesting https://api.github.com/users (api) returns System.Net.HttpStatusCode.Forbidden IsSuccessStatusCode = false
I tried to do an api request to https://api.github.com/users and I got this forbidden response returned. As it doesn't need authentication, I don't know why I got that 403 returned.
{StatusCode: 403, Version: 1.0, Content:…

Khant Htet Naing
- 128
- 1
- 3
- 11
-3
votes
3 answers
Why I can't correctly call this API passing an object into the request body?
I am pretty new in .NET and C# (I came from Java and Spring framework) and I am finding the following difficulties calling an API in the correct way.
I will try to explain my problem in details.
I have this API (defined into a project deployed into…

AndreaNobili
- 40,955
- 107
- 324
- 596