mirror of
https://github.com/melihkorkmaz/il-ilce-mahalle-geolocation-rest-api.git
synced 2026-04-25 08:35:57 +03:00
[GH-ISSUE #12] cors hatası #9
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/il-ilce-mahalle-geolocation-rest-api-melihkorkmaz#9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @zafer06 on GitHub (Mar 19, 2020).
Original GitHub issue: https://github.com/melihkorkmaz/il-ilce-mahalle-geolocation-rest-api/issues/12
axios veya fetch api ile "https://il-ilce-rest-api.herokuapp.com/v1/cities" adresinden veri almaya çalıştığımda aşağıdaki hatayı alıyorum.
Access to fetch at 'https://il-ilce-rest-api.herokuapp.com/v1/cities' from origin 'http://127.0.0.1:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.@Pasinli commented on GitHub (Mar 20, 2020):
var proxyUrl = 'https://cors-anywhere.herokuapp.com/', targetUrl = 'https://il-ilce-rest-api.herokuapp.com/v1/cities' fetch(proxyUrl + targetUrl) .then(blob => blob.json()) .then(data => { return data; }) .catch(e => { return e; });@zafer06 commented on GitHub (Mar 21, 2020):
Teşekkürler @Pasinli gönderdiğin kodlar işe yaradı. Ancak merak ediyorum bu soruna api tarafında bir çözüm bulunması daha doğru olmaz mıydı?