Thank your for your answer. Let me give you and example of my problem using a very popular public API.
I have created in Korconnect a new connection for the pokemon API (pokeapi.co/api/v2/pokemon). This API doesn’t need any apikey but the platform need one to create the connection so I invented it.
The Secure URL given by the platform is: https://adn1217f.korconnect.io/Pokemon/
The x-api-key for this connection is: TfQDTqGP732ibJonOyCNx35k3LAmoP8D1sHvCrm0
I am using the next code in my webApp:
let myHeaders = new Headers();
myHeaders.append("x-api-key", `TfQDTqGP732ibJonOyCNx35k3LAmoP8D1sHvCrm0`);
let requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow',
};
let endPoint = 'ditto';
let URI = https://adn1217f.korconnect.io/Pokemon/ + endPoint;
let resp = await fetch(URI, requestOptions);
console.log(resp)
console.log(URI);
let respStr = await resp.text();
console.log(respStr)
As you can see, this code is (almost) exactly the same as it is used in your examples but with async-await to handle the promises.
The problem I have is that when I do the get request to https://adn1217f.korconnect.io/Pokemon/ditto through POSTMAN I get a perfect response (json) but when I do the request from my code, the answer I have is this one with status 301:
“<a href=”/api/v2/pokemon/ditto">Moved Permanently.\n\n"
¿Any additional help you could give me? Thank you