Fetch API from URL #6148
Unanswered
espruino-discuss2
asked this question in
Bangle.js
Replies: 1 comment
-
Posted at 2023-08-01 by @halemmerich You need to use the Bangle.js variant of GadgetBridge. Have a look at https://www.espruino.com/Gadgetbridge#http-requests . Posted at 2023-08-01 by user156125 Ah, I see where my confusion was. I was trying to use the fetch command, instead of the appropriate "Bangle.http" command. Thank you for pointing this out to me! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Posted at 2023-08-01 by user156125
I am trying to write an app to fetch data from a website, but I was reading on here that the watch does not have its own WiFi (obviously), but Gadgetbridge does not like to have internet functionality for privacy reasons. Is there any way for me to fetch information from a URL? For reference, I'm trying to get the data from this link here:
https://labs.waterdata.usgs.gov/sta/v1.1/Things('USGS-09380000')/Datastreams?$expand=Observations($orderby=phenomenonTime%20desc;$top=1;$select=result)&$select=unitOfMeasurement,description
It returns JSON already, so easy to manage. I tried uploading the code to the IDE, but it doesn't recognize fetch which may be because of the aforementioned lack of internet functionality. Does anyone know if I'm wrong, or if it's possible another way?
Beta Was this translation helpful? Give feedback.
All reactions