Hello all.
there is a api which is given to me for integration in my application. but i dont know what strtegy they has been followed when this made. only url and headers are given to me.
when i integrate in my MVC project i have issue of Cross-Origin detail are in snapshot, i googled alot of time and as every one folllowed the strategy i modified my code but result is same. so please any one help me to fix this issue
code is below Error snpashot is attached
- <script>
- $(document).ready(function () {
- $('#btnLoad').click(function () {
- $.ajax({
- url: url,
- headers: {
- 'Access-Control-Allow-Origin': '*',
- "Authorization": "Bearer + token"
- },
- success: function (response) {
- $.toaster({ priority: "success", title: "Congrat!", message: "Data loading...." });
- console.log(response);
- },
- error: function () {
- $.toaster({ priority: "danger", title: "oooppss!", message: "failed" });
- }
- });
- })
- })
- script>
thanksin advance
more over when this api check by postman it fine.



Gopaiah NekarukantiRank #2,077 · 695 reputationPosted Nov 25, 2019, 7:30 PM EST
Mohsin ArifRank #732 · 3.2K reputationPosted Nov 25, 2019, 7:35 PM EST
Gopaiah NekarukantiRank #2,077 · 695 reputationPosted Nov 25, 2019, 8:03 PM EST
Mohsin ArifRank #732 · 3.2K reputationPosted Nov 25, 2019, 8:11 PM EST
Gopaiah NekarukantiRank #2,077 · 695 reputationPosted Nov 25, 2019, 8:28 PM EST
Jaimin ShethiyaRank #177 · 13.7K reputationPosted Nov 26, 2019, 12:16 AM EST
can you please refer below link
https://docs.microsoft.com/en-us/aspnet/web-api/overview/security/enabling-cross-origin-requests-in-web-api
Thanks