summaryrefslogtreecommitdiff
path: root/client/util.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2019-01-13 00:04:35 +0100
committerJules Laplace <julescarbon@gmail.com>2019-01-13 00:04:35 +0100
commitbb7efd0af0db8183b5b3f96ac0de1bfd9cd249ae (patch)
tree75549888c89cdb0bb1ee8d217f77b95db6e966dc /client/util.js
parent4060915f156dec87a449a10c96d166d474f2d628 (diff)
face analysis frontend scaffolding
Diffstat (limited to 'client/util.js')
-rw-r--r--client/util.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/client/util.js b/client/util.js
index f181ad0f..d0db0d98 100644
--- a/client/util.js
+++ b/client/util.js
@@ -82,6 +82,21 @@ export const preloadImage = opt => {
/* AJAX */
+export const get = (uri, data) => {
+ let headers = {
+ Accept: 'application/json, application/xml, text/play, text/html, *.*',
+ }
+ let opt = {
+ method: 'GET',
+ body: data,
+ headers,
+ // credentials: 'include',
+ }
+ // console.log(headers)
+ // headers['X-CSRFToken'] = csrftoken
+ return fetch(uri, opt).then(res => res.json())
+}
+
export const post = (uri, data) => {
let headers
if (data instanceof FormData) {
@@ -99,7 +114,7 @@ export const post = (uri, data) => {
method: 'POST',
body: data,
headers,
- credentials: 'include',
+ // credentials: 'include',
}
// console.log(headers)
// headers['X-CSRFToken'] = csrftoken