Should Web API controller class be always suffixed with 'Controller'?
public class ProductsController : ApiController { //Web API methods defined in this class }When creating a Web API controller class, is it necessary to end the name of controller class with the...
View ArticleWhat NuGet Package I need to add to a WebForms project to get...
I have a Webforms website in .Net 4.5, to which I have added the NuGet package for 'Microsoft ASP.Net Web API 2.2'.But even though I can get the Web API methods to work, I am unable to implement global...
View Articleunsupported_grant_type
Hello, I'm using VS2013 Express for web. ( Look "Web.Config" below for more details ) Following a video in youtube ( using VS2013Ultimate ) to "discover authentication in web api 2", I built my...
View Articledisplay data using web APi's
I have built the web application and built the web APi's as well.I'm sure that the web Api's are working fine because they are returning the correct json file.Now i'm building another project n the...
View ArticleGlobal Exception handling not working in Web API 2.2
I have a WebForms website project in .Net 4.5 to which I have added ASP.Net Web API 2.2 NuGet package. The Web API methods are being called successfully and returning expected values.However, after I...
View Articleodata post method - send exception or message to client
Hi,I am creating the odata web api and sending it to consumers to add new product.While adding I will check if the product is already available then I have to send a message to client "Product already...
View ArticleWeb API: Posting xml as string always post null on the server
I have a Web API which takes XML as string. Below is my API method public class ValuesController : ApiController { [HttpPost] public void Submit([FromBody]string document) { } }I have Microsoft...
View ArticleWhere does the class InternalServerErrorTextPlainResult exist?
I was looking at sample code provided by Microsoft for global error handling in Web API 2.2 at this URL, but could never find the classInternalServerErrorTextPlainResult. Where can I find this class...
View ArticleWebAPI and C# dynamic keyword question
Hi Folks,This is not an issue, am just trying to get an understanding with what is happening when using the dynamic keyword in WebApi methods.Using Mvc 5.2.0, WebAPI 2.2/5.2, JSON.Net 6.0.4 in...
View ArticleODATA Web API - Cloud
I have created odata web api service and deployed in Azure. After deployment, am able to consume the service using webrequest, add service as reference, but the same url am not able to get the results...
View ArticleREST query fails when called from webapi
Hello,I have SP 2010 list with 15k+ items. We are using REST to query data. The queries are running fine when run on browsers. However, when the same query is called inside a Webapi service, I am...
View ArticleHow to add array of strings to HttpResponseMessage.Header?
How do I add an array of strings to the HTTP Vary Header?1.Response.Headers.Vary.Add("Accept"); //pass2.Response.Headers.Vary.Add("Accept","Authorization","Accept-Encoding"); //fail3.string[3] array =...
View ArticleServiceStack authentication
Hi there,I have a ServiceStack API project and an MVC web project .i am calling a servicestack service from this web project using $.ajax.Once i logged in from web project i want to use that login...
View ArticleMapping Web API
Hello everyone and thanks for your help in advance. I am working on a SignalR project that also needs to use a jQuery dialog box. I want the dialog box to utilize WebApi, but am new to this and...
View ArticleMVC 5 or 6 Web API Client consuming remote data: Tutorial?
Does anyone know of a tutorial that illustrates how to consume data from a remote server that is not local DB or Azure?I'd prefer a tutorial that covers client and server but my immediate need is for...
View ArticlePagination In WebAPI
Currently I have following way of providing pagination for every entity/resource for a set of APIs:public IHttpActionResult GetPageUsers(int startindex, int size, string sortby = "Username", string...
View ArticleAPI to Populate JQuery Dialog Box
Hello everyone and thanks for your help in advance. I am new to Web API and am developing an application to populate a JQuery dialog box from a Web API with SQL backend. I have looked at several...
View ArticleHow to host Asp.net web api services in IIS and consume it in asp.net website
Hi,Could anyone please share any basic working sample, that will describe steps tohost asp.net web api services in IIS and also demonstrates steps to consume it in any web application or web site?Any...
View ArticleWhy is config.EnableQueryOption depreciated?
Hi I am curious as to why enabling OData query support is depreciated?
View ArticleWhy once OData enabled via config.EnableQueryOptions does this break...
I have a particular custom collection which with vanilla WebAPI (no OData enabled) This object is serialized/deserialized correctly on both sides of the wire.As soon as I enable Odata query support by...
View Article