I am doing a standard Request with the DeepL API, but the request unexpectedly throws a “resource exceeds maximum size” error:
let items = await loadItems();
async function loadItems() {
let url = "https://api-free.deepl.com/v2/translate";
let req = new Request(url);
let body = {"text": "Hello!", "auth_key": "[xxx]", "target_lang": "ES"}
req.body = JSON.stringify(body);
let json = await req.loadJSON();
return json
}
console.log("this is " + items)
Have played with the DeepL API in Postman with no problems, so I don’t think it’s a problem with the API.
Am I doing something stupid?