Return a 201
How can I return a 201 on the following? public void Put(int id, [FromBody]course course) { var ret = (from c in courses where c.id == id select c).FirstOrDefault(); ret.title = course.title; }Thanks.....
View ArticleASP.NET WEB API 2 OAuth Authentication unsuported grant_Type when accessed...
Hello All,I am developing a sample web api with OAuth authentication having bearer token support. When I am trying to authenticate the user, I am getting error in error callback as shown just below....
View ArticleGlobal Static Dictionary Initialization from Database in Webapi
I want to Initialize a global Dictionary from Database in my web Api. Do i need to inject my DBContext in Global.Asax or Owin Startup. Any example would be much appreciated.
View ArticleWeb Api that requires a Google login - how to do this on Android / IOS?
Basically this is how it is working: I issue a GET request to an address that redirects to a Google login page. Once logged in, it redirects to an azure page, which gives an access token. This is put...
View ArticleCan't Invoke Hello World
I have created a web api application using the template in VS2013. When I add a WebService.asmx to the file and run the application on that file I get a list of one methods (HelloWorld). When I click...
View ArticleWebAPI - CORS
I'm at a loss, I', having some issues when accessing a WebAPI that I created on my web server. I read and went through the changes for the CORS found...
View ArticleComplex JSON output from WEB API
I have a complex JSON request that I need to output from GET (ie. www.mywebsite.com/controller/id) and this the JSON result I need to output (JSONfile){"conf1": {"default": "string1","default2":...
View ArticleXML/JSON transformation in ASP.NET Web API
How to achieve unidirectional and bidirectional XML/JSON transformation in ASP.NET Web API?
View ArticleError reading MIME multipart body part when upload image
We have a mobile app where users can upload image. Sometimes i see this in the error log:Error reading MIME multipart body part" at...
View ArticleImplement Delete Action in RestFul Web API in View using MVC
I have a following code for the Delete action in my controller.public HttpResponseMessage Delete(int id) { try { var course = TheRepository.GetCourse(id); if (course == null) { return...
View ArticleOData $expand + $orderby not working !
hi all,I try to sort my expand array , but it not working .~/api/products?$expand=models($orderby=id desc), the results is all come out , but without sorting id desc . What 's wrong ?
View ArticleInputFormatters for XML
Hi.I'm using MVC6.0.0-beta5 and I can't find any kind of XML Input/Output formatters.I have checked the Microsoft.AspNet.Mvc and there are just JSON formatter.Do you know which is the nuget package...
View ArticleCall One Web API to another Web API
how to Call One Web API to another Web APIexampleA1 web Api service call A2 Web Api service.
View ArticleASP.Net Web api cookie encoding
Hello: I am setting cookies on my ASP.Net web api controller. This is what my code looks like:var cookie =newCookieHeaderValue(cookieName, cookieValue) {Expires = cookieExpires, Domain =cookieDomain,...
View ArticleCan i replace Asp.net WEBAPI to TCP call on any port
Hi developers and experts,i am preparing a asp.net web Api in c#, which is accessible via http request.Now i a planning to remove the functionality of Http call and want to start TCP call from the...
View ArticleODataActionParameters is always null
I am using OData V4 and have an unbound method registered this way:var getByHint = builder.Function("GetByHint"); getByHint.Parameter<string>("Hint");...
View Articlewhen save new invoice it saved items on other open invoices in other pc's ?
Hii try to use angularjs & API in my Invoice project, i finally did it and it works fine but i have 3 problems on it:1. (solved by workaround it, but really need an better way for that) - when open...
View ArticleAngularJS with API - lose list data after insert new item ?
Hii try to create invoice and i set my code to save item that user is selected to an list to let at the end loop throw this list and insert it to database, when i was set list as static every this is...
View ArticleHandling multiple tokens with OAuth 2.0
I'm sorry for the long post but it's an architectural problem and I believe that some details could be important.I'm developing a SPA using AngularJS and Web Api where exists a many-to-many association...
View Articleuse SAML as a bearer token in webAPI SPA
We have a legacy application which uses the Windows Identity Framework, written around 2010-2011. Users authenticate by logging into a client portal, which then sends a saml token to our...
View Article