Skip to content

Commit 31b93f5

Browse files
authored
Add files via upload
1 parent bde2f76 commit 31b93f5

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

assets/cors.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!doctype html>
2+
<html>
3+
<body>
4+
<pre id=result>running...</pre>
5+
<script>
6+
const url = "https://backend-test.uitpas.be/api/search/organiser";
7+
const body = {"from":0,"size":500,"query":{"query_string":{"query":"pointOfSale: true","fields":["address.zipcode","address.city","name"]}},"sort":{"name.raw":"asc"}};
8+
9+
fetch(url, {
10+
method: "POST",
11+
credentials: "include", // try with and without depending on endpoint auth
12+
headers: { "Content-Type": "application/json" },
13+
body: JSON.stringify(body)
14+
})
15+
.then(r => r.text().then(t => ({status: r.status, headers: [...r.headers], body: t})))
16+
.then(obj => document.getElementById("result").textContent = JSON.stringify(obj, null, 2))
17+
.catch(err => document.getElementById("result").textContent = "error: " + err);
18+
</script>
19+
</body>
20+
</html>

0 commit comments

Comments
 (0)