Tuesday, 22 March 2022

cross Isuue asp.net web api 2 && string spces in c#

  web.config

<system.webServer>
<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="GET, POST, PUT, DELETE, OPTIONS" />
<add name="Access-Control-Allow-Credentials" value="true" />
</customHeaders>  
</httpProtocol>
OR
var cors = new EnableCorsAttribute("*", "*", "*");
config.EnableCors(cors);

https://any-api.com/
https://elmah.io/tools/multiline-string-converter/
https://stackoverflow.com/questions/3905946/how-can-i-add-double-quotes-to-a-string-that-is-inside-a-variable

No comments:

Post a Comment

Car pooling app

 I'll create a car pooling app with real-time vehicle tracking, pickup/drop time estimates, and a list of onboard users. Since we don...