diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2019-01-13 00:04:35 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2019-01-13 00:04:35 +0100 |
| commit | bb7efd0af0db8183b5b3f96ac0de1bfd9cd249ae (patch) | |
| tree | 75549888c89cdb0bb1ee8d217f77b95db6e966dc /client/util.js | |
| parent | 4060915f156dec87a449a10c96d166d474f2d628 (diff) | |
face analysis frontend scaffolding
Diffstat (limited to 'client/util.js')
| -rw-r--r-- | client/util.js | 17 |
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 |
