Web Requests in client scripts


#1

Hi community,

Is there some way to make HTTP requests from client scripts? I see a “Requests” library referred to multiple times in the tutorial pages, but pulling up the Scripting Console, “requests”, “Requests” “request” and “Request” all lead to ‘cant find variable’ exceptions, and there doesn’t seem to be anything in the API documentation.

In addition, that function that’s supposed to include other Javascript scripts (i.e, “require”) can’t be run from the Scripting Console either.

I’m running version 0.79.0, fwiw.

Mark


#2

See this thread:


#3

I’ve had good luck using the web 3d overlay, https://docs.highfidelity.com/api-reference/namespaces/overlays.html#.Web3DProperties. This allows you to run most html/javascript in a simulated client in the 3d space.

You can talk to it from a client (interface) script using events. Best way I find to learn some of this stuff is to search the GitHub content section for the method / parameter you are interested in… https://github.com/highfidelity/hifi-content