Comments (6)
aku juga pake axios dan makasih mas ini sekarang berhasil
from daftar-api-lokal-indonesia.
Sudah mencoba pakai format XML mas?
error No 'Access-Control-Allow-Origin'
terjadi jika sisi server penyedia data tidak memperbolehkan adanya akses terhadap konten di dalamnya jika hostname dari get client
tidak dikenal.
from daftar-api-lokal-indonesia.
kalo pake xml aku belum coba mas, oalahh jadi butuh izin gitu yah ke bmkg nya berarti perlu API key yah mas?
from daftar-api-lokal-indonesia.
sama ternyata mas pake yang XML juga, aku coba masih block by CORS
from daftar-api-lokal-indonesia.
Mas @ujangaripin24 menconsume API-nya menggunakan apa mas? apakah dari sisi server atau web apps?
Jika melalui webapps, lebih baik mungkin jika diconsume melalui sisi server sehingga tidak terjadi permintaan melalui sebuah hostname, jika menggunakan NodeJS potongan kode berikut mungkin bisa membantu mas
// index.js
var axios = require('axios');
var config = {
method: 'get',
maxBodyLength: Infinity,
url: 'https://data.bmkg.go.id/DataMKG/TEWS/gempadirasakan.json',
headers: { }
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
atau bisa mencoba mengcalling dari pureJS
var requestOptions = {
method: 'GET',
redirect: 'follow'
};
fetch("https://data.bmkg.go.id/DataMKG/TEWS/gempadirasakan.json", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
Error No-Cross origin seringkali terjadi jika permintaan data dilakukan melalui sisi webapps
from daftar-api-lokal-indonesia.
Wah great to hear that mas @ujangaripin24, jika boleh mungkin bisa dielaborasi solvingnya seperti apa atau potongan kode sebelum dan sesudahnya seperti apa. Biar menjadi wawasan bagi teman" yang ada di sini
from daftar-api-lokal-indonesia.
Related Issues (20)
- Alkitab API HOT 1
- API Google Search
- Masalah pada Tahukah Anda API dan Pencarian Nomor HP HOT 2
- Tambah API HOT 1
- Error API Daerah Indonesia | RTO API HOT 2
- Tambah API (Forest API) HOT 3
- Tahukah anda API Error
- Tambah API (Bhinneka) HOT 2
- Tambahkan API PuloDev HOT 2
- A
- Test 1
- Tambah API (TimeAPI)
- Tambah API (Epic Free Games)
- Dead Link HOT 2
- API Digipos
- Ngajuin PR bang buat update url API HOT 1
- Update file to PR HOT 2
- Tambah API multi HOT 2
- Yoo Payments GATEWAY API
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from daftar-api-lokal-indonesia.