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.
0
votes
2answers
29 views
how to send multiple parameters from view to api controller in mvc4
I have multiple parameters which I have to pass to api controller.
What I was doing is
In my javascript
var routeInfo = JSON.stringify(routes);
var colors = ...
2
votes
2answers
2k views
Queryable attribute is not compiling in mvc 4 web api when trying to mark for odata
I'm using MVC 4 web api that comes with visual studio 2012.
As I've understand odata is not parsed automatically, but we need to add [Queryable] attribute to the action now.
So I added it:
public ...
0
votes
1answer
22 views
Calling webapi method gives 404
I don't understand this.
I have a webapi project setup locally on my own server, that works. I can go to http://mydomain.com/Api/Method and get my expected result no problem, works across 3g and ...
1
vote
2answers
173 views
WebAPI SelfHost site
Is it possible to setup WebAPI to Self Host like Nancy.
Such that it hosts an
/api/...
section serving up json and xml responses and hosts a
/content/...
section serving up *.jpg and ...
0
votes
1answer
24 views
Using IQueryable select to filter columns
I've been exploring WEB API based on the guide at www.asp.net, and I've run into a problem when trying to filter columns from a table.
My code is simply this:
// GET api/Admin
public ...
0
votes
0answers
11 views
Envers custom Revision Listener with Windsor Dependency Resolver in WebApi
I am currently using Envers within a C# WebApi project. Windsor is used for IoC.
I have a custom RevisionEntity which add a User property to audit the user who has made the data change.
To ensure ...
0
votes
1answer
18 views
What User-Agent to give my WebApi Requests?
I am using an api and I noticed that when I use RestSharp and do a call from my asp.net web api project my request fails.
I turned on fiddler and for whatever reason the api I am requesting thinks I ...
0
votes
1answer
27 views
POST to Web API OData, the entity that is received is null
I'm trying to send data to Web API using OData. But the entity which is received is always null.
I have this call using JQuery:
$.ajax({
url: "/odata/Products",
type: ...
0
votes
0answers
24 views
RestSharp: WebAPI and Forms Authentication CookieContainer
I successfully login to an MVC 4 Web API site and get a .ASPXAUTH Set-Cookie this way:
private void Login()
{
var client = new RestClient("http://QQQQ/MobileAPI");
...
0
votes
1answer
24 views
Can I implement message security in ASP.NET Web API?
I have a requirement to use Web API, and implement security on those calls. I know how to do what I need in WCF, but Web API is frustrating in its efforts to be simpler. SSL, I think I got that. I ...
0
votes
0answers
16 views
ASP.NET WebApi filter ANY queries on collection not working
I'm a Java guy no idea about .Net world. I'm integrating with a .Net WEB API.
/api/Products returns this
{
Items: [2]
-0: {
Name: 'Computer'
Disks: [1]
-0: {
Name: ...
0
votes
1answer
28 views
Return custom error objects in Web API
I have a web api I'm working on using the MVC 4 Web API framework. If there is an exception, I'm currently throwing a new HttpResposneException. ie:
if (!Int32.TryParse(id, out userId))
throw new ...
0
votes
1answer
48 views
Using 'Paste XML as Classes' to deserialize a Web API rest response
I am having trouble using the 'Paste XML as Classes' feature in VS2012 to properly deserialize XML results from a Rest call using Web API.
The XML response from the call looks like this:
<?xml ...
0
votes
1answer
43 views
WebAPI with Entity Framework, Code First: Doesn't generate correct Id of inserted object
I'm working with WebAPI and whenever I add an user, POST request via Fiddler, it adds an user with ID of let's say 7 even though the database is clear and it should be 1.
I've Entity Framework to ...
1
vote
1answer
9 views
Using the WebApiContrib ProtoBufFormatter on the Client Side
I'm using the WebApiContrib.Formatting.ProtoBuf NuGet package (http://nuget.org/packages/WebApiContrib.Formatting.ProtoBuf/0.9.5.0) to add support for Protocol Buffers in my Web API project.
The ...