asp.net-web-api2

How to implement oauth2 server in ASP.NET MVC 5 and WEB API 2 [closed]

廉价感情. 提交于 2019-11-26 06:50:45
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 8 months ago . First I\'ll sketch my project: For my internship I need to add functionality to an existing system. A 3rd party client must be able to access data from AX Webservices once he is authorised by the user via OAuth2. I understand that I need to make a \'proxy web service\' whereto the client can make its calls and

Web API 2: how to return JSON with camelCased property names, on objects and their sub-objects

本秂侑毒 提交于 2019-11-26 04:39:37
问题 UPDATE Thanks for all the answers. I am on a new project and it looks like I\'ve finally got to the bottom of this: It looks like the following code was in fact to blame: public static HttpResponseMessage GetHttpSuccessResponse(object response, HttpStatusCode code = HttpStatusCode.OK) { return new HttpResponseMessage() { StatusCode = code, Content = response != null ? new JsonContent(response) : null }; } elsewhere... public JsonContent(object obj) { var encoded = JsonConvert.SerializeObject

Dot character '.' in MVC Web API 2 for request such as api/people/STAFF.45287

孤街醉人 提交于 2019-11-26 03:24:34
问题 The URL I\'m trying to let work is one in the style of: http://somedomain.com/api/people/staff.33311 (just like sites as LAST.FM allow all sort of signs in their RESTFul & WebPage urls, for example \"http://www.last.fm/artist/psy\'aviah\" is a valid url for LAST.FM). What works are following scenarios: - http://somedomain.com/api/people/ - which returns all people - http://somedomain.com/api/people/staff33311 - would work as well, but it\'s not what I\'m after I\'d want the url to accept a \

No connection could be made because the target machine actively refused it?

痴心易碎 提交于 2019-11-26 03:13:21
问题 Sometimes I get the following error while I was doing HttpWebRequest to a WebService. I copied my code below too. System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:80 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) at System.Net.ServicePoint

Dot character '.' in MVC Web API 2 for request such as api/people/STAFF.45287

故事扮演 提交于 2019-11-26 01:08:16
The URL I'm trying to let work is one in the style of: http://somedomain.com/api/people/staff.33311 (just like sites as LAST.FM allow all sort of signs in their RESTFul & WebPage urls, for example " http://www.last.fm/artist/psy'aviah " is a valid url for LAST.FM). What works are following scenarios: - http://somedomain.com/api/people/ - which returns all people - http://somedomain.com/api/people/staff33311 - would work as well, but it's not what I'm after I'd want the url to accept a "dot", like the example below - http://somedomain.com/api/people/staff.33311 - but this gives me a HTTP Error