I am trying to make a post request and getting this exception:
"unsupported BodyInit type" I think the issue is with the body of the request. phoneNumbers takes on the form phoneNumbers = ["1234567890", "1234567891"] (i.e. a list of strings). I tried to do JSON.stringify(phoneNumbers) as the body, but that seems to return "[]", even if the list is not empty.
export async function findUsersByPhoneNumbersNotFollowing(userId, phoneNumbers) { const reqConfig = { method: 'POST', headers: { 'Content-Type': 'application/json', Accept: 'application/json', }, body: phoneNumbers, }; const response = await authfetch(`${API_URL}/following/recommendations/${userId}`, reqConfig); if (response.error) { throw new Error(response.error); } return response; } Where am I going wrong? The API endpoint is expecting List<String> (using spring framework, and the controller method takes this param in annotated @RequestBody)