I am trying to implement Calling an HTTP or REST API from Transaction Processor Functions
So when I am requesting GET https APIs it is working but when I am trying http APIs it is not working and throwing error:
RequestError: TypeError: Failed to fetch
and in browser console varies with APIs:
net::ERR_SSL_PROTOCOL_ERROR
net::ERR_CONNECTION_CLOSED
I have tested http APIs in postman and they are working perfectly fine. This is the code:
transaction checkApi {
o String api
}
async function checkApi(tx) {
const apiObj = await request.get({ uri: tx.api, json: true });
console.log(apiObj);
});
Is it because of CORS? can someone please explain what is the issue?