From 0ad5c2fc2cfb76e06fb8ae49e6d29347206e10f2 Mon Sep 17 00:00:00 2001 From: Dan Zeitman Date: Mon, 4 Oct 2021 19:10:34 -0700 Subject: [PATCH] Update index.js Moved structure from body to data --- 1-lambda-function/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/1-lambda-function/index.js b/1-lambda-function/index.js index b35d1f3..6f30c2b 100644 --- a/1-lambda-function/index.js +++ b/1-lambda-function/index.js @@ -9,12 +9,13 @@ const config = { headers: { Authorization: 'Basic ' + credentials, }, - body: { grant_type: 'client_credentials' }, }; +const data = { grant_type: 'client_credentials' }; + async function fetchToken() { try { - const response = await axios.post(url, {}, config); + const response = await axios.post(url, data, config); const { access_token, refresh_token } = response.data; return { statusCode: 200,