I create a Windows Service with a integrated ASP.net Host and WEB API. The host and API works fine. When I use my internet Browser I get response from my controller, so no p
I think your cors configuration is not correct. Web client and web api connections are different so I understand your problem.
I'm writing our configuration below so you can check it.
Install-Package Microsoft.Owin.Cors -Version 3.1.0
Startup.cs:
app.UseCors(CorsOptions.AllowAll)
Web Config:
<system.webServer>
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
</system.webServer>
Install-Package Microsoft.AspNet.WebApi.Cors
App_Start/WebApiConfig - Register method:
config.EnableCors();
FooController:
[EnableCors(origins: "*", headers: "*", methods: "*")]