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

0
votes
0answers
8 views

Self Host Web Api Unit Test With Area

I'm following some tutorials about creating a HttpSelfHostServer to test my Web Api. The issue I'm having is that my core API is inside an area and I cannot get my routes registered correctly. ...
0
votes
1answer
24 views

Custom Exceptions in Web API

Can someone help me in creating an exception which has the overridden message, source and stack trace values. I tried using httperror in the HttpResponseMessage, but I need to add Stacktrace and ...
0
votes
1answer
17 views

OData in Web API Doesn't Follow OData Standard Specs

First of, the standard spec for OData response looks like: { "d" : { "results": [ { "__metadata": { "uri": "http://demos/Orders(10248)", ...
0
votes
0answers
12 views

Custom Authorization using signalr PersistentConnection with websockets transport

I im trying to authorize a user for some connections in SignalR, my issue is that using WebSockets as the transport i cannot set HttpContext.Current.User without getting an exception. The ...
0
votes
2answers
22 views

Return a JSON string explicitly from Asp.net WEBAPI?

in Some cases i have NewtonSoft JSON.NET and in my controller I just return the Jobject from my controller and all is good. but i have a case where i get some raw JSON from another service and need ...
0
votes
1answer
25 views

Is it possible to use SQL Server session state with a stateless web api application?

We have a stateless web api application where we only use the token(obtained on login) as an identifier, which we decrypt, determine user and perform the action. We now need to store a rather big ...
0
votes
1answer
27 views

RESTful WebApi Filtered lists?

Suppose I have an object. public class foo() { public int Id {get;set;} public string Name {get;set;} } and a set of related objects. public class bar() { public int Id{get;set;} public ...
0
votes
2answers
24 views

breezejs with webapi not returning child entities when I use expand

I’m using WebAPI V4.0.30506.0 (this should be the stable version) with BreezeJs 1.3.5 and for some reason I don’t get child entities when I use the expand keyword. How can I get the child entities? ...
1
vote
1answer
24 views

How to deserialize JSON request from EXT.NET on ASP.NET Web Api side

I am trying to make HTTPPOST from webclient using EXT.NET libraries. Here is how my call looks like <ext:Button ID="dugmeOdobri" runat="server" Text="Odobri Narudžbe" Icon="Accept" > ...
0
votes
0answers
20 views

Data synchronization in a Chrome packaged app

In my pursuit to write a Chrome packaged app, I am struggling to get my data synchronized to the app so that it can be used in offline mode. My data lives on a server and I access it trough a ...
0
votes
1answer
20 views

NetworkCredentials and Authorization in WebApi

I am having a few problems trying to connect to a ASP.NET webapi service (which I am running myself) from a sample console app using WebClient. The webapi is the typical sample site from MVC4: public ...
1
vote
2answers
69 views

ASP.NET Web API routes not mapping to controller actions

I have an ASP.NET Web API application where I want to respond to the following routes: 1. http://localhost:1234/values 2. http://localhost:1234/values/123 3. http://localhost:1234/values/large 4. ...
0
votes
0answers
17 views

Hook Unity into Web API Filter Attributes

I have Unity running great for all the controllers in my ASP.NET Web API project - just using the default set up that comes out of the NuGet box. I have also managed to hook it up to MVC Filter ...
0
votes
1answer
24 views

.Net Web API throw exception/return response/return error response for 404/400 response?

I am developing some restful web service using .net web api. I need to return 404 (NotFoundStatus) or 400 (BadRequest) to the client for some scenarios. It seems like that there are many ways to do ...
1
vote
3answers
35 views

How do I get the error message from an HttpResponse object in WebAPI?

I have a controller that generates an exception from the following code with the following message:- public HttpResponseMessage PutABook(Book bookToSave) { return ...
1
vote
2answers
39 views

WebApi - Specify Content-Type in Uri

You can use AddUriPathExtensionMapping("json", "application/json"); To enable media type to be specified as part of the uri as seen below http://localhost/products.json How can I get WebApi to ...
0
votes
0answers
37 views

ASP.Net Web API Authentication using Authorize attribute and WorldDomination plugin

I'm reasonably new to web development so please forgive me if my terminology is off a bit. I've created an ASP.Net Web API, and for certain methods on the API I'm needing a way to tell if a user is ...
0
votes
1answer
27 views

Log duration of an ASP Web API action

I am using an ActionFilter to log all action calls of my ASP.NET Web API project. The OnActionExecuted method tells a lot about what's been happening. I just can't figure out how to find an efficient ...
0
votes
0answers
50 views

Missing data when serializing object with JSON.Net

I am working on wrapping some existing code in an ASP.Net WebAPI controller. When serializing the object with JSON.Net the string returned is always empty (just empty {} ). The class that I am ...
0
votes
2answers
21 views

Breeze, OData, and no EF

I'm learning breeze nowadays and I want to ask about using breeze without EF. The BreezeController exposes IQueryable for all entities. When a breeze request comes,OData format is used for the query, ...
0
votes
0answers
20 views

Redirect URL gets rewritten on Azure

I have an APIController that needs to redirect to another service that may have a different subdomain. Simplified code: [HttpGet] public HttpResponseMessage DoSomething() { HttpResponseMessage ...
0
votes
1answer
36 views

.Net web api, SSL + basic auth

I have multiple sets of sensor networks that are sending data to a .net web api. Somehow, I need to secure some of the endpoints of the API (so that I can be certain that the information sent to the ...
0
votes
1answer
41 views

Uploading a large file from phone

I'm trying to write a WP8 app that needs to upload a large amount of data back to my server. My server runs on ASP.net and implements REST using WebAPI. I've gotten to a point where I can upload ...
0
votes
1answer
24 views

web api odata action method to return image

We are using asp.net web api odata entitysetcontroller to get user profiles. The url that represents a single user profile looks like this http://www.domain.com/api/org/staff(123) Now bussiness ...
0
votes
1answer
22 views

ASP.NET Web API Documentation duplicate entries

I'm trying to create documentation for my API's. So far I've tried with Swagger.Net and Web API help pages Both tools provided me with correct documentation which is generated from XML but both of ...
1
vote
0answers
61 views

WebApi modelBinding fails when property inherits from Dictionary<string, string>

WebApi model binding fails when a property in the viewmodel inherits from Dictionary<string, string>. The same model binding works when the data type of the property is changed to just ...
0
votes
1answer
32 views

How do I convert a Web API JSON response to a data table?

I have a web API where if I go to a valid link, it'll display an XML. However, in my other application, when I call: using (var webclient = new WebClient()) { var doc = ...
0
votes
1answer
47 views

Order property in System.Web.Http.AuthorizeAttribute

If I have multiple authorization attributes on an action, my understanding is that for System.Web.Mvc.AuthorizeAttribute I can specify the Order property like: [CustomAuth(Order=2)] ...
0
votes
1answer
21 views

AttributeRouting - how to specify route with query-string

I'm trying to add AttributeRouting to my WebAPI project. On one controller I currently have three GET methods defined: [GET("dictionaries")] public IEnumerable<Dictionary> Get() ...
0
votes
2answers
53 views

ASP.NET WebApi Post Method - 404 When Passing Parameters

I cannot for the life of me figure this out. I have a web api controller with Get and Post methods. The Get method works fine with and without parameters, but the post breaks when I try to add a ...

1 2 3 4 5 126
15 30 50 per page