Flic Home

    Community

    • Login
    • Search
    • Popular
    • Users

    Http Request - Content sent not received

    Developers
    1
    1
    397
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • igor.fernandes
      igor.fernandes last edited by

      Hello,

      I've been using the flic buttons for some time to create an action in another app, but for some reason recently when I do the http.makeRequest the content sent is not received in the other app.

      In the code example I call the scan function to find the buttons, and when it's 'completed' I send respective bdAddr to register the button in the other app, but for some reason that information doesn't reach the app...

      Has there been any change in the way the information is passed on?! Or am I doing something wrong?! Can someone help me!

      code example is below:

      var buttonManager = require("buttons");
      var http = require("http");

      var url = "https://xxxxxx/registerButton";
      var token = "Bearer yyyyy"

      scan()

      function scan(){

      scanWizard = buttonManager.startScanWizard();
      
      ...
      
      scanWizard.on("complete", function(bdAddr) {
      	var btn = buttonManager.getButton(bdAddr);
      
      	http.makeRequest({
      		url: url,
      		method: "POST",
      		headers: {"Content-Type": "application/json", "Authorization" : token},
      		content: JSON.stringify({ "id": bdAddr }),
      	}, function(err, res) {
              });
      

      });
      }

      1 Reply Last reply Reply Quote 0
      • First post
        Last post