HTML Request in Typescript repository

195 Views Asked by At

I am using Functions in Foundry and using for this purpose Typescript. I am wondering if it is possible to make a HTML Request inside a specific function.

I have already checked every HTML request method I know for JS (https://www.freecodecamp.org/news/here-is-the-most-popular-ways-to-make-an-http-request-in-javascript-954ce8c95aaa/). However, these methods are not available in a Typescript repo.

Looking on the internet I found a library called conjure-typescript-runtime (https://github.com/palantir/conjure-typescript-runtime) which I think could help. This was developed by Palantir. This library is already installed in Foundry and could be used in Typescript but I cannot find any example on how to do a PUT request using it.

Looking forward to hearing from you and getting some help.

Best, Pablo

1

There are 1 best solutions below

1
On

While Typescript as a language certainly supports making arbitrary network requests, the execution of Typescript within the Foundry Functions architecture does not allow connections outside of the Foundry enclave and the connections that are allowed are moderated through custom APIs like the Ontology API or the User API rather than arbitrary direct connections.