protected void Application_BeginRequest(object sender, EventArgs e) { HttpContext.Current.Response.AddHeader("Access-Control-Allow-Origin", "*"); if (HttpContext.Current.Request.HttpMethod == "OPTIONS") { HttpContext.Current.Response.AddHeader("Cache-Control", "no-cache"); HttpContext.Current.Response.AddHeader("Access-Control-Allow-Methods", "GET, POST"); HttpContext.Current.Response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Accept"); HttpContext.Current.Response.AddHeader("Access-Control-Max-Age", "1728000"); HttpContext.Current.Response.End(); } }
<service name="restservice.UserType" behaviorConfiguration="ServiceBehaviour"> <endpoint address="" binding="webHttpBinding" contract="restservice.IUserType" behaviorConfiguration="webHttp"/> </service> <service name="restservice.User" behaviorConfiguration="ServiceBehaviour"> <endpoint address="" binding="webHttpBinding" bindingName="StreamedRequestWebBinding" bindingConfiguration="StreamedRequestWebBinding" contract="restservice.IUser" behaviorConfiguration="webHttp"/> </service> <service name="restservice.Location" behaviorConfiguration="ServiceBehaviour"> <endpoint address="" binding="webHttpBinding" contract="restservice.ILocation" behaviorConfiguration="webHttp" /> </service> <service name="restservice.BMS" behaviorConfiguration="ServiceBehaviour"> <endpoint address="" binding="webHttpBinding" contract="restservice.IBMS" behaviorConfiguration="webHttp"/> </service> <service name="restservice.FriendService" behaviorConfiguration="ServiceBehaviour"> <endpoint address="" binding="webHttpBinding" contract="restservice.IFriendService" behaviorConfiguration="webHttp"/> </service>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)