Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Companion to any web server using Fetch

I am very new to Fitbit Development and js in general. Currently, I am able to get the accelerometer data from the app to companion. Now  I am searching for a way to access that data on my local computer. According to what different posts the data can be transferred through fetch post method. But, I am not sure how to access the data on the server  after sending it from companion.

Current;y I am using 

fetch('https://10.0.0.41:441/', {
method:'post',
headers: {
'Content-Type': 'application/json'
},
body:JSON.stringify(evt.data)
}).then(function(result) {

.....

 

to send data but I am not sure what the server code must look like to display this data on localhost.

Best Answer
0 Votes
1 REPLY 1

What you're trying to do is difficult but possible.

For a start, you'll need a non-self-signed security certificate installed on your computer. (I never succeeded in doing this on Windows.)

Then, you'll need to write (or find) a server to run on your computer than can receive the POST requests and save the request data as a file.

Peter McLennan
Gondwana Software
Best Answer
0 Votes