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.


Jaimin ShethiyaPosted Nov 26, 2019, 5:16 AM
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
Gopaiah NekarukantiPosted Nov 26, 2019, 1:28 AM
Mohsin ArifPosted Nov 26, 2019, 1:11 AM
Gopaiah NekarukantiPosted Nov 26, 2019, 1:03 AM
Mohsin ArifPosted Nov 26, 2019, 12:35 AM
Gopaiah NekarukantiPosted Nov 26, 2019, 12:30 AM