Skip to main content
Filter by
Sorted by
Tagged with
87 votes
2 answers
75k views

What is the best way to return an image with 2 parameters (x and y for resize). For example ~/api/image12345/200/200 Will return a 200 by 200 jpg/png/or gif Should I return a System.Drawing.Image ...
Max Alexander's user avatar
86 votes
10 answers
127k views

I try to build a web application with dotnet core web api,but i do not know how to set index.html as start page which can be done with dotnet framework web api easily. And i tried to use app....
HongyanShen's user avatar
  • 1,535
86 votes
8 answers
102k views

I have a simple .net core web api with one action: [Route("[action]")] public class APIController : Controller { // GET api/values [HttpGet] public string Ping() { return ...
Calanus's user avatar
  • 26.4k
85 votes
4 answers
133k views

I am using the Web Api 2 template that comes with Visual Studio 2013 has some OWIN middleware to do User Authentication and the likes of. In the OAuthAuthorizationServerOptions I noticed that the ...
SimonGates's user avatar
  • 6,129
85 votes
2 answers
44k views

What are the fundamental differences of those functions? All I know is all three result in a 201, which is appropriate for a successful POST request. I only follow examples I see online, but they don'...
Mickael Caruso's user avatar
84 votes
16 answers
92k views

I am using Entity Framework and having a problem with getting parent and child data to the browser. Here are my classes: public class Question { public int QuestionId { get; set; } public ...
user avatar
84 votes
1 answer
50k views

While I do understand the concept of Task, ActionResult, etc. I still feel unsure which would be most intuitive to type in a controller if nothing else is specified. Taking consideration to be as ...
DonkeyBanana's user avatar
  • 3,646
83 votes
10 answers
237k views

I am trying to figure this out. I was not getting any useful error messages with my code so I used something else to generate something. I have attached that code after the error message. I have ...
texas697's user avatar
  • 6,587
82 votes
11 answers
141k views

I've set up an ASP.NET web application starting with an MVC 4/Web API template. It seems as though things are working really well - no problems that I'm aware of. I've used Chrome and Firefox to go ...
rwkiii's user avatar
  • 5,876
81 votes
11 answers
176k views

I have client and a server running on different ports. The server is running Web API 2 (v5.0.0-rc1). I tried installing the Microsoft ASP.NET Web API Cross-Origin Support package and enabled it in ...
Gaui's user avatar
  • 9,009
81 votes
5 answers
79k views

Is it true that "ApiController will get deprecated in .NET Core"? Asking since I'm planning to use it in new projects.
Viji's user avatar
  • 2,629
76 votes
11 answers
94k views

The scenario is simple, I need to log in from another server (different from the API server) to retrieve the access token. I installed Microsoft.Owin.Cors package on the API Server. In Startup.Auth....
Blaise's user avatar
  • 22.4k
75 votes
24 answers
170k views

I'm trying to get an API Controller to work inside an ASP.NET MVC 4 web app. However, every request results in a 404 and I'm stumped. :/ I have the standard API controller route from the project ...
Ted Nyberg's user avatar
  • 7,421
74 votes
6 answers
92k views

I hope I haven't missed anything obvious in the doco, if I have I'm sure someone will help. I'm using asp.net webapi to return a DTO, with date fields. These are serialized using JSON.Net (in format '...
leon.io's user avatar
  • 2,834
74 votes
10 answers
113k views

As title says, I’ve got 500 Internal Server Error from GET request to an IQueryable action. The body of the error is empty. That error happens after my action returns result. I use ASP.NET Web API RC....
oddy's user avatar
  • 1,900
73 votes
6 answers
94k views

I have a WebAPI that works without issue. I have tested locally and deployed to my server and configured this service in IIS to use Basic Authentication. I am able to browse to my service and I ...
brianhevans's user avatar
  • 1,193
72 votes
8 answers
89k views

I am trying to perform a Post to my WebAPI from a c# WPF desktop app. No matter what I do, I get {"error":"unsupported_grant_type"} This is what I've tried (and I've tried everything I could find):...
OverMars's user avatar
  • 1,049
72 votes
2 answers
27k views

I am looking at one WebAPI application sample that has this coded: json.SerializerSettings.PreserveReferencesHandling = Newtonsoft.Json.PreserveReferencesHandling.Objects; and another with this ...
user avatar
72 votes
3 answers
81k views

At work we got a problem with case sensitive REST api which ignores wrongly spelled parameters without returning any error. In my opinion this is bad. Then it comes the general question: Should a ...
mynkow's user avatar
  • 4,608
71 votes
3 answers
89k views

I am new to ASP.Net Web Api Core. I have been using ASP.Net MVC for past few years and I always have written an ActionFilter and used JSON.Net for Serializing data into JSON. So, in that way I ...
Zeshan Munir's user avatar
  • 1,256
71 votes
1 answer
151k views

I'm trying to get a post request to work with the web api. Following is my api controller. public class WebsController : ApiController { [HttpPost] public void PostOne(string id) { } ...
Amila's user avatar
  • 3,816
71 votes
6 answers
198k views

I am trying to use a client certificate to authenticate and authorize devices using a Web API and developed a simple proof of concept to work through issues with the potential solution. I am running ...
Kevin Junghans's user avatar
70 votes
8 answers
111k views

I'm using System.Web.Http.RouteAttribute and System.Web.Http.RoutePrefixAttribute to enable cleaner URLs for my Web API 2 application. For most of my requests, I can use routing (eg. Controller/param1/...
Chris Paton's user avatar
  • 5,233
70 votes
3 answers
72k views

I'm following a Microsoft sample to implement email validation with Identity 2.0.0 I'm stuck at this part public ApplicationUserManager UserManager { get { return _userManager ?? ...
Marc's user avatar
  • 16.6k
70 votes
3 answers
24k views

Introduce the problem I would like to know whether we are using Web API 1 or 2. My own packages.config indicates version 5.0.0. Is that Web API 1 or 2? Search, and research I have tried Googling ...
Shaun Luttin's user avatar