diff --git a/rest/getTweetInfo.ts b/rest/getTweetInfo.ts index fe9c754..32c3499 100644 --- a/rest/getTweetInfo.ts +++ b/rest/getTweetInfo.ts @@ -54,13 +54,13 @@ export const getTweetInfo = async ( }, }; } - const text = await res.json(); + const text = await res.text(); const value = tryToErrorLike(text); if (!value) { throw new UnexpectedResponseError({ path: new URL(path), ...res, - body: await res.text(), + body: text, }); } return { diff --git a/rest/getWebPageTitle.ts b/rest/getWebPageTitle.ts index b3388b2..1203ae3 100644 --- a/rest/getWebPageTitle.ts +++ b/rest/getWebPageTitle.ts @@ -53,13 +53,13 @@ export const getWebPageTitle = async ( }, }; } - const text = await res.json(); + const text = await res.text(); const value = tryToErrorLike(text); if (!value) { throw new UnexpectedResponseError({ path: new URL(path), ...res, - body: await res.text(), + body: text, }); } return { diff --git a/rest/page-data.ts b/rest/page-data.ts index 57a9f27..76996ea 100644 --- a/rest/page-data.ts +++ b/rest/page-data.ts @@ -51,13 +51,13 @@ export const importPages = async ( ); if (!res.ok) { - const text = await res.json(); + const text = await res.text(); const value = tryToErrorLike(text); if (!value) { throw new UnexpectedResponseError({ path: new URL(path), ...res, - body: await res.text(), + body: text, }); } return { ok: false, value }; @@ -94,13 +94,13 @@ export const exportPages = async ( ); if (!res.ok) { - const text = await res.json(); + const text = await res.text(); const value = tryToErrorLike(text); if (!value) { throw new UnexpectedResponseError({ path: new URL(path), ...res, - body: await res.text(), + body: text, }); } return { diff --git a/rest/project.ts b/rest/project.ts index 18e832e..c407c35 100644 --- a/rest/project.ts +++ b/rest/project.ts @@ -32,13 +32,13 @@ export const getProject = async ( ); if (!res.ok) { - const text = await res.json(); + const text = await res.text(); const value = tryToErrorLike(text); if (!value) { throw new UnexpectedResponseError({ path: new URL(path), ...res, - body: await res.text(), + body: text, }); } return { diff --git a/rest/replaceLinks.ts b/rest/replaceLinks.ts index 83634eb..8fba580 100644 --- a/rest/replaceLinks.ts +++ b/rest/replaceLinks.ts @@ -47,13 +47,13 @@ export const replaceLinks = async ( ); if (!res.ok) { - const text = await res.json(); + const text = await res.text(); const value = tryToErrorLike(text); if (!value) { throw new UnexpectedResponseError({ path: new URL(path), ...res, - body: await res.text(), + body: text, }); } return { diff --git a/rest/search.ts b/rest/search.ts index 7c5b055..06f7fdb 100644 --- a/rest/search.ts +++ b/rest/search.ts @@ -47,13 +47,13 @@ export const searchForPages = async ( }, }; } - const text = await res.json(); + const text = await res.text(); const value = tryToErrorLike(text); if (!value) { throw new UnexpectedResponseError({ path: new URL(path), ...res, - body: await res.text(), + body: text, }); } return { @@ -100,13 +100,13 @@ export const searchForJoinedProjects = async ( }, }; } - const text = await res.json(); + const text = await res.text(); const value = tryToErrorLike(text); if (!value) { throw new UnexpectedResponseError({ path: new URL(path), ...res, - body: await res.text(), + body: text, }); } return { ok: false, value: value as NotLoggedInError }; @@ -162,13 +162,13 @@ export const searchForWatchList = async ( }, }; } - const text = await res.json(); + const text = await res.text(); const value = tryToErrorLike(text); if (!value) { throw new UnexpectedResponseError({ path: new URL(path), ...res, - body: await res.text(), + body: text, }); } return { ok: false, value: value as NotLoggedInError };