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

learn more… | top users | synonyms

-2
votes
0answers
7 views

How to use same Microsoft Account between Windows Store App and Companion Website?

I have a MVC5 website and WebApi using ASP.Net identity. I have configured the website to use Microsoft Account as an external login. The Windows Store App will use the WebApi, and the user should ...
0
votes
0answers
19 views

Routes that starts with the same prefix as controller not working

Why Routes that starts with the same prefix as controller not working? namespace WebApi.Controllers { [RoutePrefix("subscribers")] public class SubscribersController : ApiController { ...
0
votes
0answers
10 views

The 'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed

i am using angular and asp.net API. the issue is by adding the CORS in API code is working on internet explorer but not on chrome and firefox. here is the error. XMLHttpRequest cannot load ...
0
votes
0answers
10 views

Conditional logic in MS Load Test Project

Ok, I'm stuck. I've got a Web Api that I benchmark using VS integrated Load Test project. There's one catch though, I need conditional logic. For example: if Svc1 returns param1, then next ...
0
votes
1answer
8 views

deserializing json in asp.net web api

I'm trying to send data from android application to asp.net web api, I have two values to send login and password, i put them in NameValuePair List and sent them. Here is my code : DefaultHttpClient ...
0
votes
0answers
11 views

Same parameters name in Web API URL Routes

I am wondering if its possible to use the same parameter name in URL routes using ASP.NET WebAPI. For example [HttpGet] [Route("{userid}")] [HttpGet] [Route("{userid}/customers")] ...
1
vote
0answers
16 views

Debugging ASP.NET - Can I copy XML comments to the debug folder?

I have an ASP.NET project which generates an XML documentation file. I'm using Swashbuckle and would like it to be able to reference the XML comments file while debugging. However, when I run the ...
1
vote
3answers
46 views

Creating WebAPI to allow a string to be passed with '/' characters

I'm creating a WebApi in ASP.NET. I want one of my get methods to allow a string to be passed into it. This string will function as a path to a branch in TFS where I'll do a QueryHistory to return its ...
0
votes
0answers
9 views

JQueryMvcFormUrlEncodedFormatter returns model as null

I have WebAPI post method which accepts a Complex model as input Sample code: public string Post([FromBody]Student value) { string name = value.Name; return name; ...
0
votes
1answer
15 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
2answers
11 views

ODataController BearerToken Authorization denied

I'm trying to implement an Authentication Provider for my WebApi Services. Im using this guide: http://bitoftech.net/2014/06/01/token-based-authentication-asp-net-web-api-2-owin-asp-net-identity/ For ...
-1
votes
0answers
31 views

Can't load assembly in an ASP.NET MVC Web Api in IIS

I have an ASP.NET Web MVC 4 Web Api with .NET Framework 4.0 and C#. The log is here: http://pastebin.com/CHa3zvCP It's very big to post it in SO. The app is installed in C:\intepub\wwwroot\WebApi\ ...
0
votes
0answers
25 views

Pass Parameters in OData WebApi Url

Using Web Api I have an OData EndPoint which can return Products from a database. I have multiple databases with similar schemas, and want to pass a parameter in the URL to identify which database ...
0
votes
1answer
20 views

.NET Web API : deserialize JSON object with property as List(Of object)

Imagine I created a Filter class like this...... Public Class Filter Public Enum enuOperator [EqualTo] = 0 [Like] = 1 [In] = 2 [StartsWith] = 3 [EndsWith] ...
1
vote
0answers
14 views

How to implement a custom OAuth refresh token method in MVC WebApi 2

I have created my own Login Module instead of using /token. As we can see that i am returning a refresh_token which allows my access_token to get a new one. -To access my login api i request ...
1
vote
0answers
30 views

ASP.Net MVC application login session handling with Web Api services

I am working on application whose details are as follows: Its 3 tier architecture. Web Tier (ASP.Net MVC) -- Service Tier (ASP.Net WebApi 2) -- Database Tier(MS SQL 2014). Application will also have ...
0
votes
0answers
16 views

How to get the IP address from ApiController?

How do I get the IP address of the client's IP address from inside an ApiController? What is the equivalent of Request.ServerVariables?
-4
votes
0answers
25 views

Which one is right for my solution?(WCF,Web API,Web Service) [on hold]

I have a solution for search and sorting flights information. So, want to send this information to other sites. Every one, with respect to username(send user and password with request) get ...
1
vote
3answers
16 views

How to pass input json with byte[] in web api postman

{ "From":"[email protected]", "To":["[email protected]"], "Cc":["[email protected]"], "Bcc":["[email protected]"], "Subject":"Export", "TemplateName":"Agent", "EmailType":"Agent", "Attachments":[{ ...
0
votes
0answers
8 views

upload file from phonegap camera to .Net web api

Server side public class UploadController : ApiController { public async Task<HttpResponseMessage> Post() { // Check whether the POST operation is MultiPart? if ...
0
votes
2answers
41 views

Is database change notification better than trigger?

I'm developing an application using Oracle database and WCF/WebAPI service. The service should know about changing certain table in database. I surfed the web and found a technology in Oracle RDBMS ...
0
votes
0answers
17 views

Mcirosot ASP.NET Web Api with just url as querystring … fails

I have a web api method: [Route("system/{*url})] public IhttpActionResult Get(string url) and a url encoded url i pass to there e.g. ...
-2
votes
2answers
45 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
0answers
16 views

Should keep-alive be disabled on Web API?

I have an MVC 5 website on .NET 4.5. I also have 2 API on the same server (both built on .NET). The website makes asynchronous web service calls to the APIs on the same server. It seems that these ...
0
votes
1answer
19 views

Create Custom Json Error in Asp.NET MVC

I am using a JavaScript plug-in and if there is an error it expects format like; {error: 'You are not allowed to upload such a file.'} In my MVC Web API I am throwing error like; var error = ...
0
votes
2answers
29 views

WebAPI ActionFilterAttribute OnExecuting not firing

I have the following Web API ActionFilterAttribute namespace namespace.Filters { using System; using System.Collections.Generic; using System.Linq; using System.Web.Http.Controllers; ...
0
votes
0answers
8 views

Hal+Json PagedRepresentationList Links using WebApi.Hal

This is a tough question to ask or explain. Im using the WebApi.Hal libraries for a C# MVC WebApi. The return response looks like this "TotalResults": 4, "TotalPages": 1, "Page": 1, "_links": { ...
1
vote
1answer
21 views

Web Api with Owin with JWT always fails to authorize request

I have followed the tutorials up till this point in the series. I am using one project in the solution that acts as both the token issuing authority as well as the resource server. The JWT is ...
0
votes
0answers
14 views

Add help page to ASP .NET web api 2.2 located in a class library

I have a solution composed by two projects: a "main" web project containing only the global.asax file and a class library project containing ASP.NET Web.Api 2.2 package. When I run the main web ...
-1
votes
0answers
19 views

Hide one of properties in model class ASP.NET Web API and C# [duplicate]

Can I hide one of properties in model class in C# and don't return it to client? For example, I have this model: public class TransferResponse { [Key] public int Id { get; set; } public ...
1
vote
1answer
74 views

How, I can change password, if I do not know the old password?

I need create method, which can change password in database if I do not know the old password. For example, I have next code: public IHttpActionResult ChangePassword(ChangePasswordBindingModel ...
4
votes
1answer
41 views

Automatically Binding Another Parameter in WebAPI

In MVC this sort of thing is pretty trivial. Let's say I have an MVC action signature: public ActionResult SomeAction(InjectedObject a, ConstructedObject b) And let's say that the request from the ...
-1
votes
1answer
13 views

Post twitter status with url using twitter REST API 1.1 [on hold]

I am trying to post a status from website to a Twitter account and succeeded using https://api.twitter.com/1.1/statuses/update.json API and with the help of this link. When I try to add another ...
3
votes
0answers
38 views

Generate PDF controlled by action filters?

I need to generate PDF reports of certain data sets when the client passes a certain parameter (?print) in the query string of a Web API route. Now I'm wondering if a custom action filter is a ...
0
votes
0answers
20 views

Response model for specific status codes using Swagger

I am using Swagger to document my REST API (using asp.net web api 2). Is there a way in swagger to give response models for each possible responses for a given api call? I am annotating the status ...
1
vote
0answers
21 views

Service Layer Implementation Ideas with MVC4 Application

I have a ASP.NET MVC4 web application with the following layers. Domain Objects Business Data Access ASP.NET MVC4 Web One more layer need to be added for consuming the application as a service to ...
0
votes
0answers
27 views

AngularJS Web Api HttpHandler Image Downloader

My AngularJS application is interacting with ASP.NET Web API to full fill the request which is working fine. it has an use case that allows user to download user specific secure PDF document. I have ...
0
votes
0answers
10 views

Custom Route Handler (for OPTIONS) if registered before config.MapHttpAttributeRoutes() not working

I am trying to fully implement a true RESTful Web API. As part of this, I'm trying to expose OPTIONS through the Web API. I'm using ASP.NET 5.2.0 (Web Api 2.2) Here's the setup: In my ...
0
votes
1answer
19 views

Convert an array of image physical paths on server to array of urls

I'm using Web Api to return a list of URLs to a client application. Since the Image files get created on the server, when a request comes in I need to respond with a list of the Image path URLs. Right ...
0
votes
0answers
19 views

How can I add JSON data to my file upload in Web API?

I followed this guide http://jaliyaudagedara.blogspot.com/2014/08/how-to-directly-upload-files-to-amazon.html and I was able to successfully upload files to Amazon S3 in my Web API Project. Happy with ...
0
votes
0answers
10 views

asp net httpselfhostserver for controllers that do not extend ApiController

Hi I am new to asp net programming and I am trying to test my asp net application using HttpSelfHostServer link: http://www.c-sharpcorner.com/UploadFile/2b481f/self-hosting-in-Asp-Net-web-api/ by ...
0
votes
0answers
23 views

To add a service layer or not to MVC Apps

I am a web guy and I was just hired by a company that does only desktop apps (WCF/WPF) to help them start moving to web apps, using asp mvc. Their current architecture uses 3 different servers, UI on ...
0
votes
1answer
28 views

C# Anonymous Functions Inside WebAPI Function?

I have a Web API function that is called from somewhere, but in it, I have a service that requires delegates, specifically for complete and error (though they're examples. public async ...
0
votes
1answer
22 views

How do I enable Application Insights server telemetry on WebApi project that uses OWIN?

We are having a bunch of problems (read long response times) with a couple of projects in production and wanted to see exactly what was happening on the server. I then proceeded to add Application ...
0
votes
1answer
12 views

Accessing WebApi on local website returns 404 error, whereas same deployed on cloud application works fine

I am facing a weird issue, I have a webapi in my web application "https://myapplicationurl/api/Login/" which worked fine before with local iis deployed website. And after deploying the website to ...
0
votes
1answer
5 views

WebApi 2.2 IIS 7.5 something is setting max-age

I have a .Net 4.5.2 WebApi 2.2 REST service. Windows 7 machine running IIS 7.5. It doesn't do much but return the current date/time. When hosted in IIS, I get response headers that look like this: ...
0
votes
0answers
7 views

How do I configure IIS 5.0 to persists the deployment of asp.net web application across Windows reboot?

Setup OS - Windows Embedded Standard (2009), IIS - 5.0, Web application - asp.net mvc 4.0 web api with .net framework 4.0 I deployed sample web application into IIS under default websites using ...
1
vote
1answer
20 views

ASP.Net Web Api 2, json web token, logout and ensure that the server should not authenticate token anymore

I am working on asp.net web api 2 and used JWT for authentication. The application is working fine as it generates token on login request from user, and then user can use that token for subsequent ...
0
votes
0answers
30 views

Web api not hitting breakpoint and getting 500 internal server error

We are developing webapi project using visual studio 2012. After build my project it shows Build succeeded. I put breakpoint into my webapi function and I was trying to get my output using fiddler. ...
1
vote
1answer
19 views

Associating Data with authenticated user in ASP.NET MVC optimization

I am using ASP.NET WebAPI with the built in authentication and identity services that come with the Visual Studio template. I now have it that a user can access the system and be authenticated. The ...