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
1answer
13 views

Specify a unique identifier attribute for an object across webapi Models

In a POST call to a WebApi I am trying to return a Created(newobject) thing. But there is no signature for Created in ApiController that can only take the object and do the rest. It works fine if I ...
0
votes
1answer
19 views

Webapi object parameter with FromUri is null if no querystring passed

I have the following API Controller action [HttpGet] [Route("assets")] public async Task<HttpResponseMessage> Get([FromUri]SearchCriteria searchCriteria) { } When i test this with fiddler by ...
0
votes
0answers
14 views

Creating a dictionary model binder in ASP.NET WEB API 2

I need some serious help with dictionary model binding in ASP.NET Web API 2. Basically, the client communicating with the API in question can only pass a post request that not only contains a file to ...
0
votes
1answer
17 views

Azure Service Fabric and Newtonsoft.Json compability issues

I've created a new Service Fabric Application to host a WebAPI service using Owin Self-host. I updated all the nuget packages for the service project to the latest version and now when I try to start ...
1
vote
1answer
25 views

Web API verfication of requests

Currently I have a Web API project with FluentValidation tied in to verify the requests that come in. This is working fine to make sure that the requests make sense. My next step is to verify the ...
1
vote
2answers
29 views

MVC.NET Routing

I want to add a new route to my Web Api, which will read various ids and then filter a bunch of books. So the final url should read something like http://localhost/api/books/1/1/1/1 Now I have added ...
2
votes
1answer
35 views

Design of Application in Azure Service Fabric

I need help how to think about designing our application to fit into the new Azure Service Fabric template. Today we have an application built on Azure Cloud Services. The application is built around ...
0
votes
0answers
24 views

Global Exception Handler Not Called

I'm attempting to create an oWin middleware class that will capture all exceptions in the stack, and handle them appropriately. A Following this article, I created an IExceptionHandler class to pass ...
0
votes
1answer
11 views

Publish the web Api in different server

I am new to WEB API,which i want to publish in Hostgator server and need the URL so i can access through my app,Is there any procedure, so i need to do before publishing web api 2 in different ...
0
votes
2answers
39 views

Web Api 2 - Check if User Is Logged In

I am still finding my way around in ASP.NET. I am experimenting with getting Angular code talking to a Web API 2 end point, which will only be accessed from within the solution itself. One thing I ...
0
votes
1answer
17 views

Inheritance security rules violated while overriding member: 'Autofac.Integration.WebApi.AutofacWebApiDependencyResolver.BeginScope()'

I am trying to build an asp.net web api 2.0 application using VS 2012 and asp net web tools for vs 2012 on .Net 4.5.2 framework; when i try to run the application, Inheritance security rules violated ...
0
votes
0answers
14 views

Large file (> 2gb) is not written to disk

I have a Web API 2 project which accepts file uploads. Uploading small files works pretty well, but when it comes to large files, they simply are not written to disk. It appears to me that this ...
1
vote
1answer
23 views

Send token in header GET-method

There is a site and a web api. All the files I receive from the web api server. I have an ADFS OAUTH2 authorization on the site. And I need get the images from the web api with the auth token. So ...
0
votes
1answer
24 views

Entity Framework 6 multiple nested master-detail insert

I have this tables scenario model So as you can see there are a multiple nested master-detail table and I have a requeriment where I have to insert at one time the first three entities, I'm using ...
0
votes
1answer
29 views

Get error when I try to pass date value in URL to web api method

I create this date variable in client side: this.latestDate = new Date(2001, 1, 1,1,1,1,1); Here how it looks in client watch: self.latestDate: Thu Feb 01 2001 01:01:01 GMT+0200 (Jerusalem ...
0
votes
0answers
20 views

ExceptionHandler for WebAPi unit test

I have a GlobalExceptionHandler which handles all the exceptions of a WebAPI in a central way. I need to add some unit tests to make sure that the exceptions catched by this class generate the Results ...
0
votes
0answers
8 views

Web Api 2, with different kind of security

I have a web-api 2 project which uses tokens to recognize requester and then Authorize him using his roles. I need to add another way for authentication for some methods. How to do it? More data: I ...
0
votes
1answer
26 views

What is the common hook up point for a proper Dependency Injection with MVC5 and WebApi2 controllers?

I have both MVC controllers and WebApi controllers in the same project. I would like to inject a service and a logger into controllers through their constructor. Is a DependencyResolver a proper point ...
1
vote
2answers
38 views

Error 401 on WEB API 2 when there is lot of request from Android device

I’m developing an Android App and a Web Service that communicate. My Web Service is in WEB API 2 with token bearer authentication. My problem is that when I send too many requests (~20 request in 15 ...
0
votes
0answers
16 views

Dissecting ASP.NET MVC Identity for OAuth Bearer Authentication

I'm learning how to put the Asp.Net MVC Identity 2.0 to work. I have this code that works for OAuth Bearer [HttpGet] [ActionName("Authenticate")] [AllowAnonymous] public String ...
1
vote
2answers
27 views

RESTful service and naming conventions

My entity is called Item. POST /api/items create a new Item PUT /api/items/{id} update an existing Item GET /api/items/{id} get Item by id However, I need to retrieve ...
1
vote
1answer
42 views

Automapper in Webapi Controller Unit test

I have a controller method in my webapi project which calls a service method and converts the response of the service method into a Dto object for sending the response. The controller looks something ...
0
votes
0answers
13 views

Authenticate android app through Google for custom web-api2

Building your own web-api2 services using visual studio 2015 becomes very easy where you can maintain users and credentials. with few additional steps, you add external logins for the major providers, ...
1
vote
0answers
22 views

Login with FB into ASP.NET Core MVC 6 API from iOS app

I've been googling for the solution for a several days and with no results. I have ASP.NET Core API and my native iOS app supports FB login. Now I want to use a token that I get from FB SDK to ...
0
votes
0answers
2 views

Audio Streaming in cordova using WEB API

I am making an app where i am using cordova and WEB Api to storing the media file(audio),i am uploading the audio file to sql server 2008 has a base64 and storing it,now i want to stream it in my app ...
0
votes
2answers
21 views

How to create web API and MVC solution separately?

I'm new to the .net application. am trying to develop an application for Accounting Purpose. Am totally confused that how can I use the design pattern, MVC is preferred. I have to use this app both ...
1
vote
0answers
9 views

Video Streaming from Any IP Camera with WEB API2?

Is it possible to play video of my IP Camera in ASP.NET MVC application using the WEB API 2? OR Can i do this without using WEB API? My cameras are in my premises (NVR). I already had Desktop ...
1
vote
1answer
15 views

provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server, pgsql

I am using Dapper to connect to pgsql database. The below code was working few days back. But don't know why its not working now. The same credentials are working with pgadmin3 but not with the c# ...
0
votes
1answer
18 views

Setting AllowedQueryOptions = AllowedQueryOptions.All for all controllers

I have a Web API project where I want to allow the callers to use all the different query options on all controllers. Inspired by this thread and this thread I added the following code to my ...
0
votes
1answer
28 views

Application identity authentication in Azure Mobile app. How?

I'm using custom authentication with Azure Mobile App based on following this article. Client application is Cordova App Steps I did: Turn on App Service Authentication Add ...
0
votes
0answers
17 views

.NET 4.0 client for Web API 2

I recently wrote an Web API 2 project for my client app to consume. Since my client app is targeting .NET 4.0, I have to install the following two NuGet packages: Install-Package ...
0
votes
0answers
27 views

Get Request from Angular to Web Api custom BufferedMediaTypeFormatter

I am making a Get Request from Angular Js to a RestFull WebService ASP Net. The object is to get custom JSON serialized data. I need only some values to get serialized, not all. For this purpose I am ...
0
votes
0answers
12 views

Xamarin HttpClient hangs if request is untrusted

I have a Web-API server with some functionality that uses self-signed SSL certificate. I have a class library that is used for both windows and android apps. The important things about this class ...
0
votes
0answers
36 views

How are Web API access tokens validated on the server?

Once a WebAPI access token is generated, how does WebAPI validate that token for the next request? I wonder if I can use an [Authorize] attribute, it must compare the token sent by the client with the ...
0
votes
1answer
23 views

Parameters are not getting passed from angular to Web API in the POST call

Below is my angular and Web APi Code.In the post method null is getting passed instead of India Angular Code: HWApp.controller('TestCtrl', function ($scope, $http) { $scope.SendData ...
0
votes
0answers
34 views

How do I get the user claims after I have logged in with IdentityServer 4?

I have used this sample to setup IdentityServer4 with angular and WebApi (ASP.NET Core): https://github.com/damienbod/AspNet5IdentityServerAngularImplicitFlow Everything is working, I can login and ...
1
vote
1answer
26 views

Web Api call not reaching action?

I have my WebApiConfig setup like this: public static class WebApiConfig { public static void Register(HttpConfiguration config) { config.MapHttpAttributeRoutes(); ...
0
votes
0answers
26 views

How to use ASP.Net Core RC1 Identity for mobile JWT authentication (dnxcore)

I'm building an asp.net core RC1 (dnxcore) web api 2 backend for a mobile application. I need to implement authentication (on a EF7 Sql database) but every bit of information I find seems to be ...
0
votes
0answers
21 views

Formatting JSON in ASP.NET Web API

I'm building web API for Android app in ASP.NET. How can i format JSON to return only part of information but not whole object from database? For example when i want to get all categories and ...
0
votes
1answer
41 views

How to get real-time data for my web application? [duplicate]

My Scenario is that I have a HTML5 web application that shows a bunch of icons on Google Maps. The client is pure AngularJS/Javascript, the backend is a web service of WebAPI, Entity Framework and ...
0
votes
1answer
20 views

pass parameters to web api controller with jquery data attribute

I have this jquery call: jQuery.ajax({ type: "POST", url: "http://localhost:5832/api/Login/Post", data: JSON.stringify({ username: 'user12', password: '1234' }), ...
1
vote
1answer
31 views

make local web api call from local web forms app

I want to know if its possible to make this call: jQuery.ajax({ type: "POST", url: "http://localhost:5832/api/Login", data: "{username: user1, ...
0
votes
2answers
28 views
+150

How to authenticate in WebAPI using OAuth bearer calling style in WS-Federation?

Is there an out of the box extension for Ws-Federation authentication in OWIN middleware libraries to handle Web APIs using authentication header instead of cookies? // OAuth bearer calling style ...
1
vote
2answers
32 views

Angular $http is not sending data

I know it has been solved here many times, but I'm still not able to get it working. My js call is: var data = { value: 7 }; $http.post('api/controller/method', data); But in fiddler there is no ...
0
votes
0answers
8 views

Asp.Net Web Api Odata V4 - Concurrency Checking

Below code is generated from Wep Api Odata v4 scaffolding tool. PUT Method public IHttpActionResult Put([FromODataUri] string key, Delta<Product> patch) { Validate(patch.GetEntity()); ...
0
votes
0answers
16 views

403: Forbidden Error in AngularJS Website ON IIS 7.0

I deployed 2 projects under one domain(1.AngularJS and 2.MVCWebAPI). IN Parent Root i deployed AngularJS Project and WebAPI Project Deployed Under Child root,Example of My Website Structure on IIS ...
0
votes
1answer
26 views

Best method to handle continuous stream of data input in SQL Server

I'm developing an application where there is continuous stream of data into the database and these data might contain duplication with the data that already inside the database. Hence I need to ...
0
votes
1answer
41 views

Sending the exception message to the client if a web api action method errors

I have a try catch in my controller action method and if there is an error I would like to send the exception.message to the client using the proper method that implements IActionResult. How would I ...
0
votes
2answers
25 views

Web API - Protect GET from anchor tag using CORS

i have created a GET web api method that is going to be referred to from an anchor tag outside of my application (one of our vendors). i was thinking this would not work out of the box because of ...
1
vote
0answers
36 views

Surfacing large image tags that require api authentication

I'm working with a system that is currently switching from using cookie authentication to identity server. The front end of the application is a SPA using KnockoutJS. The SPA has access to a WebAPI ...