diff --git a/client/src/common/utils/RequestUtil.js b/client/src/common/utils/RequestUtil.js index b4392f4..fd3bc5c 100644 --- a/client/src/common/utils/RequestUtil.js +++ b/client/src/common/utils/RequestUtil.js @@ -12,4 +12,13 @@ export const jsonRequest = async (path, headers = {}) => { } catch (e) { return null; } +} + +// Run a POST request and get the json of the response +export const postRequest = async (path, body = {}, headers = {}) => { + try { + return (await request(path, "POST", body, {...headers, "Content-Type": "application/json"})).json(); + } catch (e) { + return null; + } } \ No newline at end of file