Web API Service – How to use “HttpContext.Current” inside async task
I’m using a “Post” async method of webApi rest service:
I’m using a “Post” async method of webApi rest service:
I have a VS2012 MVC4 solution where I test Web API Controllers.
I followed this asp.net tutorial by Mike Wasson, and managed to set up the related entities just fine, but when I applied this logic to my project the more complex entity relations (in that there are more of them; that’s the only difference) wouldn’t succeed in an OData call, I got a 404 with this payload:
i’m making a request do a asp.net webapi Post Method, and i’m not beeing able to get a request variable.
I am using the ASP.NET Web API to build a prototype of a web service (and site) which has a method to download a file. When the user on the front-end presses the export button a jQuery ajax GET request is made and received by the controller which on it’s turn calls the method named Excel (shown below). The method runs without any problem and finishes. When I look in Chrome at the header (see https://skydrive.live.com/redir?resid=2D85E5C937AC2BF9!77093) it receives the response with (as far as I am concerned) all the right headers.
I am attempting to expose an IQueryable<> over ASP.NET Web API and I find that I need to keep the data source open until the request completes, so that the OData query system built into ASP.NET Web API can do its job.
I am re-implementing a request logger as Owin Middleware which logs the request url and body of all incoming requests. I am able to read the body, but if I do the body parameter in my controller is null.
Using Web API and OData, I have a service which exposes Data Transfer Objects instead of the Entity Framework entities.
As the title states, I’m wondering if you can use the attribute-based routing of WebAPI 2 with WebForms. I feel like this can obviously be done given you can use WebAPI2 just fine in a WebForms application… I just can’t figure out how to enable attribute-based routing.
I’m trying to send data from my Android client as a POST request to my Web API Backend but it returns a 404 response code. Here’s my code: