I'm facing an issue in React fetch, it gives me an incomplete response, so when I parse the response into JSON, it was returning me an error.
Code:
export default async (url, body = null, method = 'GET') => {
let config = {
method,
};
try {
const response = await fetch(url, config);
if (!response.ok) {
throw new Error(response.statusText);
}
return await response.json();
} catch (error) {
console.warn(error);
throw error;
}
};
Does fetch has a maximum response size? If yes, how to increase it?