KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm developing an app where HTML and javascript chunks are delivered down to different clients. I'm able to GET the html/javascript chunks by adding the following to web config file: <system.webServer> <modules runAllManagedModulesForAllRequests="true" /> <httpProtocol> <customHeaders> <add name="Access-Control-Allow-Origin" value="*" /> <add name="Access-Control-Allow-Headers" value="Content-Type" /> <add name="Access-Control-Allow-Methods" value="POST, GET, OPTIONS" /> </customHeaders> </httpProtocol> This is working great for doing GETS. The problem I'm running into is doing POSTs cross domain using jQuery: $.ajax( { type: 'POST', url: url, crossDomain: true, data: JSON.stringify(data), dataType: 'json', contentType: 'application/json', success: function(responseData, textStatus, jqXHR) { alert('Success'); }, error: function (responseData, textStatus, errorThrown) { alert('POST failed.'); } }); I will have numerous clients consuming my app (hopefully). I thought about using a proxy, but I do not have control of the client servers so I'm not able to install a httpHandler to act as a proxy. Any suggestions on how I can POST json data from different clients cross domain to my ASP.Net MVC app?
Tags (comma-separated)
Save Edits
Cancel