ASP.NET Web API 2 is a framework for building HTTP services for clients like browsers and mobile devices. It is based on the Microsoft .NET Framework and an ideal choice for building RESTful services.

learn more… | top users | synonyms

0
votes
0answers
6 views

Elmah.Contrib.WebApi is not logging the routing exceptions for Web API 2

I am using Web API 2.1 and trying to log all unhandled exceptions using ELMAH. I am trying to log errors for the following cases: Exceptions thrown from controller constructors. Exceptions thrown ...
0
votes
0answers
9 views

DI error MVC5, WebAPI2 (Autofac.WebApi2 3.4.0) Autofac Error Parameterless public constructor error comes randomly

I am getting an intermittent error at times as below An error occurred when trying to create a controller of type 'BoardWebApiController'. Make sure that the controller has a parameterless public ...
-1
votes
3answers
43 views

Web API 2 REST Get() not receiving parameters: Angular

I am having a problem with my REST Get() method. I am calling it with parameters from my AngularJS controller but the id parameter is not being populated correctly. Here is my Web API 2 controller: ...
0
votes
1answer
10 views

C# Web API2: simple routing with integer parameter is not working

I have a simple controler. I starts 2 URLs, one is working the second is not. Im using VS 2013 EXPRESS :). http://localhost:53416/api/payments/ - works and displays "1" ...
-1
votes
0answers
14 views

AngularJs Intranet Windows Authentication

I'm working on angular app for intranet application. I hosted angular and WebApi in IIS as separate application. I need to validate the current windows logged-in user against Active-Directory group. ...
0
votes
0answers
11 views

New suite of service wrapping earlier endpoints

We have about 10 Web API service endpoints. No we are creating a suite of wrapped service endpoint for these endpoints, an iterative step to categorize/segment the earlier set of services in to ...
0
votes
0answers
15 views

WebApi 2 return types

I'm looking at the documentation of of WebAPI 2, and i'm severely disappointed with the way the action results are architected. I really hope there is a better way. So documentation says I can return ...
0
votes
1answer
11 views

Deploying in azure error Could not resolve this reference. Could not locate the assembly System.Web.Http, Version=4.0.0.0

I'm trying to deploy a Website in Azure, but I have this error: D:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3245: Could not resolve this reference. ...
0
votes
0answers
16 views

EnableQueryAttribute with PageSize messes up pre-sorted list

When I set the [EnableQuery] attribute on a ApiController method in WebAPI 2.2 it seems to break the ordering of response. [ResponseType(typeof(IEnumerable<Project>))] ...
-1
votes
0answers
15 views

Implement authorization with NHibernate

I want to implement authorization in my enterprise app. I'm using asp.net web api and nhibernate with repository pattern. I'm using singel sign on an getting user claims to deal with authorization.
0
votes
0answers
21 views

Web API - Handling all requests and errors

After reading through the following questions: Turn IIS7 HTTP Error Handling Off? catch all unhandled exceptions in ASP.NET Web Api ...
0
votes
2answers
31 views

Secure webapi 2 without authorisation or user login

I looked everywhere for an answer about securing my webApi but always i'm pointed to OAuth or openID, but i don't want the user to login or authenticate. This is my problem: I have a webapi which is ...
1
vote
0answers
8 views

Why am I getting 405 message for not existing post metod

I create empty WebApi in vs2013 community. Get Method return ApiName,ApiVersion,ServerTime Etc. But I tried post something for non-existing method, api return 405 message. Then I create method, its ...
0
votes
0answers
20 views

IHTTPActionResult custom response and unit testing with WebApi 2

I have created a class which is as follows public class Response<T> : IHttpActionResult where T : class { private readonly T _body; .... public ...
1
vote
1answer
31 views

OAuth access and refresh token control / management on user password change

We are in the process of developing a in house mobile application and web api. We are using asp.net web api 2 with asp.net Identy 2 OAuth. I have got the api up and running and giving me a bearer ...
0
votes
0answers
13 views

Value cannot be null. Parameter name: httpContext for StructureMap.WebApi2 in Web API2 project

I have used StructureMap.WebApi2 nuget package for Web API 2 project. The Web API controllers use constructor injection to inject a repository dependency which should be resolved by StructureMap Ioc.. ...
0
votes
1answer
52 views

Routes that starts with the same prefix as controller not working

Why Routes that starts with the same prefix as controller not working? With below code on my controller I am making a get call where RoutePrefix is same as the controller name. Now I am making a call ...
1
vote
2answers
61 views

WEBAPI2 performance of many vs single controller

So, is it better for me to make several requests to a single WebAPI2 controller or make the same amount of requests to many controllers. i.e does a single controller handling 10 requests perform worse ...
0
votes
0answers
23 views

autofac violation of generic constraint

I am getting this error in my asp.net web api project which I suspect is due to some mistake I must have made when configuring my container: GenericArguments[0], 'Model.AppUser', on ...
-2
votes
0answers
27 views

How to define a Rest Api for methods with multiple params in C#

I already worked defining rest apis for some backends, I understand how to do rest urls for CRUD operations, for example GET /api/countries/ GET /api/countries/1/states but right now I am working ...
1
vote
0answers
10 views

Web Api max parameter length

I have a very simple dto public class RisRequest { public string APIKey { get; set; } public string Message { get; set; } } And a nice easy web api [HttpPost] public ...
0
votes
1answer
20 views

Correct way to implement Http API method for exporting data to file

I'm implementing an API method that allows for exporting some data to a file. The format of the file is selected by the caller of the method. The API method currently has an URI-form like so: ...
0
votes
0answers
8 views

All the controller in WebAPI getting cached implicitly

I have implemented 'CacheCow' in 'WebApi2' . I have default in memory cache implemented. GlobalConfiguration.Configuration.MessageHandlers.Add(new CachingHandler(GlobalConfiguration.Configuration)); ...
0
votes
0answers
15 views

context menu N-level expanding

Code for create right click context menu i am using angularjs for the ng-click bind function is working for the fist level only after i am not able to bind the function to ng-click can you help. ...
0
votes
1answer
11 views

How to pass authentication header (basic) to OData Service from a .NetClient

I was trying to implement a client for a odata service by following this article http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/odata-v4/create-an-odata-v4-client-app ...
-2
votes
2answers
50 views

Returning an array as a string with Web Api 2 [on hold]

I have a Web Api 2 end point that returns Json containing an array of image urls. The response from it looks like this { "Status": 0, "Message": "Success", "Images": [ ...
0
votes
1answer
9 views

Web API 2.2 - OData v4 Routing Prefix?

I have a side-by-side Web API 2.2 APIController and OData v4 ODataController. My APIController uses routing attributes internally like this (there are no predefined routing defaults): ...
0
votes
0answers
19 views

Grouping nested categories and calculating totals

I'm working on a MVC/WebAPI project with AngularJs, and come across a challenge which i'm trying to tackle. I am receiving a list of tasks, which can be sorted into categories and subcategories. My ...
0
votes
1answer
16 views

Nested change sets in a batch payload are not supported : Odata - asp.net web api 2

I have Batch route enabled in config, please refer below code. namespace WebAPI { public static class WebApiConfig { public static void Register(HttpConfiguration config) { // Web ...
0
votes
0answers
14 views

Autofac cannot resolve parameter ApplicationUserManager

I'm trying to configure Autofac to play nice with my Web API/Oauth Identity project, but it does not seem to work. I keep getting the 'cannot resolve parameter ApplicationUserManager on constructor ...
-1
votes
0answers
12 views

How to implement an angular ngInfiniteScroll with a $http service?

I'm currently building a SPA using Angular JS with ASP WEB API 2. Could someone please share their thoughts on implementing the angular ngInfiniteScroll with a $http service. Currently i am using ...
0
votes
0answers
30 views

Null reference exception using Microsoft.Unity on DisposeOfChildContainer()

I am working on mvc-5 application which also has webapi. Application is throwing System.NullReference Exception. Error message System.NullReferenceException: Object reference not set to an instance ...
0
votes
0answers
10 views

How do I get web Api 2.0 to create bearer token using windows auth

I have the requirement that my MVC application use Mixed Auth meaning both Windows Auth and Basic Auth. I have done this before but not with the new Identity model and Web API 2.0. The Web API is ...
0
votes
0answers
15 views

web api 2 authentication to an existing mvc application

We have a non restful MVC application with it's own form based authentication. We will be adding some restful web api endpoints to it which will have the authentication logic. When username and ...
1
vote
1answer
36 views

Cannot access Azure API App. Swagger doc is working fine in the Azure Web Portal

After having published my Azure API App through Visual Studio 2013, I cannot access any of my REST endpoints. (The Azure Web Portal shows the swagger doc though). See here. When going to the API App ...
0
votes
0answers
19 views

Assembly 'System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' uses 'System.Net.Http.Formatting, Version=5.2.3.0

I m getting the below error message while running the WebAPI service. 'System.Web.Http, Version=5.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located ...
0
votes
1answer
41 views

Controller Versioning in Web Api 2 using URL

I want to use URL-Based versioning for my controller. best solution that I found was code below. I'm looking for better solution for this. I tried Constrain It didn't work maybe i did some thing ...
0
votes
2answers
22 views

Calling custom methods in API controller

I added a method in my web api controller: public String GetpeopleInFamily(string familyId) I followed some examples from this question: Custom method names in ASP.NET Web API I updated my ...
0
votes
0answers
22 views

HTTP 500 Error when Posting to Web API WP8.1

I know there are tons of questions about Http 500 error codes, but I haven't found any answers that work for my issue from them, so I thought I'd post my own. I'm building a Windows Phone8.1 app with ...
0
votes
1answer
24 views

OAuth server token endpoint gives back 404

I'm working on token-based authentication and authorization between my SPA and web services. I found great articles in this topic written by Taiseer Joudeh and based on this I started to build up my ...
-3
votes
0answers
29 views

How to retrieve“return” image from database by ajax where the folder of picture in webapi service application and consume this by using asp mvc [closed]

How to retrieve "return" image from database by ajax where the folder of picture in webapi service application and consume this by using asp mvc
0
votes
0answers
14 views

How to pass Headers value from angularjs to asp.net application

I am using angularJS to call .NET web api. But I am not able to pass headers or may be I am not able to get values from headers in .NET application or may be I have problem with both things. Scenario ...
0
votes
0answers
15 views

Web API help page duplicating Action for all areas

I'm working with Web API 2, and it seems to pull up my existing API calls already, except it's duplicating all the calls for each area that i have. For example, say i have 3 areas, and in one of ...
0
votes
1answer
29 views

Get PK value by passing in non-PK value using EntityFramework

I'm working on building a Windows Phone 8.1 app that uses a Web API and Entity Framework to connect to a SQL database. With my current setup, I have data objects for my entities in my services ...
0
votes
0answers
8 views

How do i query a blog details along with its blog posts using Web API 2

I have a Model for Blog, One Blog has many posts. How do I retrieve a blog details asynchronously using await along with is post object? I want to send this as json using WebApi 2 when function return ...
0
votes
0answers
32 views

Using Facebook access tokens obtained in mobile app to access ASP.Net WebAPI2 controller actions

Setup Client: mobile app built on Cordova Backend: ASP.net WebAPI2 (based on the standard template) configured with facebook login provider. Problem Having authenticated the user in the mobile app ...
0
votes
1answer
43 views

InvalidOperationException: No OWIN authentication manager is associated with the request

I created a new WebAPI project (VS 2013, .net framework 4.5.1, c#) with the example template, Added a new controller and tested this on my local computer. In my computer, everything is working good ...
0
votes
1answer
40 views

Angular receiving a 500 error but the server is completing the action with no issue?

I am calling a WebApi Method that adds to a database. This method succeeds and throws no exceptions; however angular gets a 500 error: POST "MyServer" 500 (Internal Server ...
-1
votes
0answers
51 views

how to return a web api response with angular

I am trying to return a zipfile from a web api controller. I used a example from this post I see that a zip has been created with the selected documents but i do not know how to access it for ...
0
votes
1answer
13 views

Visual Studio Error When Creating New ASP.NET Web Application

I have successfully created Web API projects a few days ago using Visual Studio 2013 update 4. Today when I try to create a project using the same default project that comes with VS, I get this error: ...