Click here to Skip to main content
15,894,291 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I have one requirement where your server can be IIS, Linux etc and client will be pure html so how can you achieve the cross domain communication with these server(getting data and posting data to the server) maintaining a session as well? using angualr js ,jquery etc (No dependency in particular platform i.e java, .net)

Let say,
Data A will be from A Server
Data B will be from B Server etc.

What I have tried:

I have tried of implementing WCF ReST service which emits the data in the form of JSON thinking that the no. of clients will be consuming the JSON data is this will suffice my requirement
Posted
Updated 25-Dec-16 23:00pm
v2

1 solution

As the client is HTML you only have to focus on the server...
The keyword is 'CORS'[^]
There is a nice article on how to create a Web API application (that can be easily used from HTML) that enables cross origin requests: Enabling Cross-Origin Requests in ASP.NET Web API 2 | The ASP.NET Site[^]
Now this can be easily ported to .NET Core and hosted on Linux too...
Building Your First Web API with ASP.NET Core MVC and Visual Studio | Microsoft Docs[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900