Open Nate-Wessel opened 2 years ago
API request works with cURL but I get a CORS error with JS fetch.
curl -XPOST \
-H 'X-API-Key: 1810451d142aec081b71013f85c0e5aca567ab9123cba182ba03dcc75950e8c2' \
-H 'Content-type: application/json' \
-d '{"statement": "SELECT geometry FROM a93d93b2-afeb-44da-a2b5-75bedf49297c LIMIT 100"}' \
https://api.ee.namara.io/twirp/query.QueryService/Query
const API = 'https://api.ee.namara.io/twirp/query.QueryService/Query'
const headers = new Headers({
'X-API-Key': '1810451d142aec081b71013f85c0e5aca567ab9123cba182ba03dcc75950e8c2',
'Content-type': 'application/json'
})
const data = {
statement: "SELECT geometry FROM a93d93b2-afeb-44da-a2b5-75bedf49297c LIMIT 100"
}
fetch( API, { method:'POST', headers, body: JSON.stringify(data) } )
.then(console.log)
Not ready yet.