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 (1)

1
vote
1answer
13 views

"The requested resource does not support HTTP method 'PUT' ASP.Net Web API

My jQuery Put request does not work, when I run my code in debug mode the put function does not get called, and from FireBug I can see this error: The requested resource does not support HTTP ...
0
votes
0answers
14 views

Dynamically loaded controls from Web API

So this is more of a best practices question. I have a restful web api with a data access layer that is using EF6 and a web MVC project that sends DTOs via RestSharp to the API get what I need from ...
0
votes
0answers
10 views

asp.net web api2 json web token “401 Unauthorized”

I am learning asp.net web api2 json web token from JSON Web Token in ASP.NET Web API 2 using Owin I download this code and run. but always return Authorization has been denied for this request. I ...
1
vote
0answers
6 views

The entity type ApplicationUser is not part of the model for the current context solution

So for school I got the task to make an API so you can login on a database and after you logged in, you can access some data. To login, we're using AspNetUsers made from another project that uses MVC. ...
2
votes
2answers
15 views

Moq WebApi async method

I'm new to testing with Moq, so I'm confused a bit regarding ReturnsAsync. Here is my test method, where I'm expecting ReturnsAsync should receive type that will be returned by method defined in Setup....
0
votes
1answer
19 views

`ExceptionHandling` not found?

I'm referencing System.Web.Http.dll, full path: C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Web.Http\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Http.dll However, I'm getting a compile exception ...
0
votes
0answers
8 views

SignalR web applications multiple Working processes in IIS 7.5 and 8

In my company we have many web applications on a web server. Recently we developed a Chat module to this applications using SignalR. But a strange problem occured on these applications. In time this ...
0
votes
0answers
21 views

Uploading files with AngularJS to WebAPI

My WebAPI expects a model with multiple HttpPostedFileBase properties. I've made a form with corresponding number of inputs like this: <input type="file" ng-model="item.image1"/> and also ...
0
votes
1answer
13 views

Posting XML to WebAPI - parameter is aways null

I'm trying to post XML to an action method. The parameter is always null. Does anyone know what I'm doing wrong? The controller class: namespace TestNetCore.Controllers { [Route("api/[controller]...
-1
votes
0answers
10 views

Integration of office 365 in web application with one side login

I am going to an integration of office 365 in our web application. its seems like suppose I have office 365 account, so when I logged into office 365 after that when I open my web application it ...
0
votes
1answer
28 views

Web api cache architecture

Net web api developer and i want to know if im working correctly. Im saving a changeable objects into the cache. Other developers on my team said only static data should be stored in the cache. So ...
2
votes
0answers
22 views

Web API 2 unit testing controller method not called?

I'm trying to make unit tests for my Web API 2. I have a method that returns an IHttpActionResult [ResponseType(typeof(Order))]] public IHttpActionResult GetOrder(int orderId) { return Ok(...
1
vote
1answer
12 views

Web API Unit Test NLog assembly error

I'm trying to add unit tests to an existing Web API 2 application. In my test project i've added a reference to the .dll of my Web API from it's obj/release folder. The Web API uses NLog. I initiate ...
-1
votes
0answers
13 views

ASP.net USER Authentication

HI I need to enable token based authentication in my asp.net web api. I dont know how to do that. for example when U call http://localhost:61510/api/Orders , currently it showing relevant json list. ...
0
votes
0answers
16 views

.Net Class library DLL configuration file is not there (After deployment). but it still works

It might be a dumb question, but I haven't found a answer for it. I have a WebAPI class library. This class library is basically used to search object in Active Directory. It reads active directory ...
2
votes
1answer
32 views

Having Web Api called by only my website

I have a website and web api. What I want is when ever someone call my web api methods, it should deny the request. But My website call the web api then it should process and respond. It's not just ...
0
votes
0answers
11 views

ASPNET WebAPI get cookie with space in the key name

So I got a website in MVC/WebAPI in which I need to set a cookie in the response and read it on requests. It all works fine, that is until a third-party tool inserts a cookie on certain occasions and ...
0
votes
1answer
12 views

http.put throwing error in Angular 2 / Web API using Chrome but not IE

I'm trying to get angular 2 working with web api in a test learner project, but I've hit a question with http.put and wondering if anyone can shed some light on it. I can POST an object to the web ...
0
votes
0answers
17 views

Can't use the word “gets” in body of HTTP POST call

As the title suggests my API is working fine but whenever the word "gets" is inside of the body (in JSON) of the post call, I get a 404. Is there some sort of encoding that is needed that I am missing?...
0
votes
2answers
18 views

Customizing OData DateTime output

I have the following model: public class PersonModel { public int Id {get; set;} public DateTime BirthDay {get;set;} .... } When a make a get request OData returns a DateTimeOffset ...
0
votes
0answers
21 views

Parameter error “The input string is not formatted correctly”

In a textbox I have to write a name that is in the database, when clicking the button has to load data in the gridview, then I added the textbox. I have the following query, I have to display the ...
1
vote
0answers
30 views

Why are my URL parameters not being encoded?

I'm developing an application with a WebApiController with a GET method that looks like the following: public class MyController : ApiController { [HttpGet] [Route("groupIdType/{groupIdType}/...
0
votes
0answers
9 views

How can I do checked a check box on a pdf templete getting the form fields?

var pdfNotice = Path.Combine(System.Web.Hosting.HostingEnvironment.MapPath("~/Content/Forms/Reports"), "Notice.pdf"); var formField= PDFHelper.GetFormFieldNames(pdfNotice); formField["...
1
vote
0answers
18 views

Owin.TestServer incorrectly finds multiple controllers in Web Api 2

I am setting up integration testing for a WebApi using the in-memory Owin TestServer and am getting the error Multiple types were found that match the controller named 'values'. This can happen ...
0
votes
0answers
48 views

Very slow performance on LINQ subquery

I am facing a performance issue when doing a LINQ subquery in C#. The query is as follows: var _result = _db.Prices .Join(_db.Vendors, e => e.VendorId, v => ...
0
votes
1answer
36 views

Protecting Web API 2.2 with IndetityServer4

I have Web API 2.2 which uses .Net 4.5.2 framework which is being used by angular2 application and there is existing IdentityServer4 implementation. I want to protect my Web API using IdentityServer4. ...
1
vote
1answer
26 views

Web Api route with multiple params 404ing

I have the following route in my WebApiConfig config.Routes.MapHttpRoute( name: "PaginateMessages", routeTemplate: "api/Message/PaginateMessages/{conversationId}/{...
0
votes
1answer
20 views

C# WebAPI HelpPage customization - Url Endpoint

I'm having a really simple issue that I cannot figure out how to word in search results so I'm hoping I can find the solution here by explaining. I'm exploring the Helppage area in ASP.NET WebAPI. ...
0
votes
0answers
14 views

Returns binary file and an other object with C# IHttpActionResult

I've learned how to returns binary files from C# Web Api here. Now I want to do the same thing with a IHttpActionResult. I've found some answers here. But what if I'd like to return an other object ...
1
vote
1answer
53 views

Enabling CORS in Azure Service Fabric Web Api

I have an angular app that sends an http request to my Service Fabric Web API (deployed on a Secure Service Fabric cluster) like so: $scope.request_headers = { "Content-Type": "...
-6
votes
0answers
64 views

Get public and private post

Please find the tables below UserTable userId userName mobileNumber 1 tom 11111111 2 harry 22222222 3 mart 44444444 4 tonny 323232233 FollowingTable ...
0
votes
0answers
26 views

How to implement Push notifications

I need to implement push notification in my application, whenever a table gets updated by other user(updating some records through UI). I have been googling from the morning,but I cant able to ...
0
votes
1answer
39 views

Send image from Ios application to web api service

We have an IOS application which send images to a asp.net web api application. So we convert images to Base64 then we send it to the web service as a string . The problem is that the size of the ...
-1
votes
1answer
31 views

Unable to get webapi results

I don't know how to see the get api results in the browser. I tried to get the response with this Url (http://localhost:8269/api/getproducts) but get an error: <Error> <Message> ...
0
votes
0answers
22 views

How to use ninject as object provider or service locator in this case

That's the Ninject CreateKernal method: private static StandardKernel CreateKernel() { var kernel = new StandardKernel(); kernel.Bind<IMongoContext>().To<...
0
votes
1answer
20 views

How to configure Swashbuckle to ignore property on model

I'm using Swashbuckle to generate swagger documentation\UI for a webapi2 project. Our models are shared with some legacy interfaces so there are a couple of properties I want to ignore on the models. ...
0
votes
0answers
17 views

WebApi2: Action that depends on UserRole

I have few roles, let's say "Godmode" and "Guest". I have one route, let's say "[Route("api/show")]". User authenticated throught http Authorization header. When "Godmode" user fires my route, I ...
0
votes
1answer
17 views

preflight request in enabled CORS ASP.NET Web API 2 application

I have a Web API application which is used in our intranet. We also used windows authentication for define a limitation on who can access to these Web APIs in the Intranet. In addition, We have an ...
0
votes
0answers
12 views

How to chain APIs using Azure API management

How to chain multiple APIs on the same URL using Azure API management? I have two APIs the user store and that user recources api. I want to build rest api so resources will related to user. ...
0
votes
0answers
17 views

Why i could use a single instance per owin context

I worked on a project that have ninject as DI manager. In startup class, there are some lines to configure the db context, user manager and role manager to use a single instance per request app....
0
votes
3answers
56 views

C# API Return string instead of XML wrapped string

I'm using ApiController and I can't get the call to return anything other than XML. public class GuideController : ApiController { [AcceptVerbs("GET")] [HttpGet] public string Get() {...
0
votes
2answers
52 views

How to know client URL name?

I have created web-api to provide service like pin-code, Bank IFSC Code and so on, from my website named as http://www.ajaxserver.com My all api is hosted on my site and my all client access using my ...
1
vote
2answers
57 views

async void vs async task in Web API: an asynchronous operation was still pending

We have Web API controllers that look like this: public class HomeController : ApiController { Logger logger = new Logger(); [HttpGet, Route("")] public IHttpActionResult Index() { ...
0
votes
0answers
13 views

What is the proper way to periodically call web API from the same hosted web site

We developed web API hosted in IIS. We want to call certain APIs ourselves periodically. Ideally for simplicity of setup we want to have that code that calls API periodically also to be inside of this ...
0
votes
2answers
39 views

Query from db with entity - one to one relationship

I have two models, configured in a one-to-one relationship: public class PointOfInterestModel { [Key] public int Id { get; set; } [Required] public string Name { get; set; } ...
8
votes
2answers
85 views

ASP.NET Core MVC/WEB API with self-referencing type does not return json array

Hello WEB API developers! I have problems when I try to return array object with my WEB API in MVC6. On the debug controller, I obtain two or more objects but the result only sends a response with ...
0
votes
0answers
13 views

DataContractSerializer not deserializing knowntypes properteis

I have a ASP.Net WebAPI Resource named as Vehicles (VehiclesController) with a POST method. My Client has a legacy system that will generate an xml document and post that xml to my Vehicle Resource. I ...
0
votes
0answers
13 views

Omit metadata from odata

I need to omit the metadata from odata json object. My requirement is same as explained in the post remove Odata.metadata in asp.net web api OdataController and followed the same solution. Also tried ...
4
votes
0answers
58 views

JSON Serialization slow

I have a very simple ASP.NET WebAPI endpoint that does one call to our database, and return those rows as JSON. The response size is around 180KB (180 records). When I deploy that project to Azure ...
0
votes
1answer
16 views

Return nested List from web api using Entity Framework and navigation properties

I'm trying to return a JSON with a nested list using Navigation properties but I keep getting null in the 'Usuario' collection here's the output. [ { "$id": "1", "id": 1, "encabezado":...