Help with getting data on http

i cant get my data to show up on my http i have been trying for a few days to get this to work and no luck the http link is https://agent.electricimp.com/F6NvTzZE7bsK

First of all, don’t give your real Imp key … it might get abused.

So you are using a website for the user interface? Or what is happening there?

I can’t imagine it’s a good idea to have the agent be the web page server. There’s no way to hide your Imp key doing it that way? Can you describe how the page is getting served?

@bradydennis - the issue is that you are assuming that the body of the request is JSON, but you are not passing it JSON data, you are passing it a string.

It looks like you’ve commented out the portions of your request handler that would be using JSON - in order to make your code work, all you should need to do now is comment out this line:

local json = http.jsondecode(request.body)

@mlseim - We often host webpages out of a device’s agent. It’s a really quick to prototype something / build a device + controller with absolutely no external server. Also - security through obscurity (keeping your agent URL secret) is not the best approach in the real world (although often fine for hobbiests). There are some ways to implement a layer of security on top of what’s here… but that’s another post all together.

Thanks for explaining … something I’ll have to learn more about.

if i take out that line the everything shows up but then when i move the slider the data doesn’t send back to imp that it moved but it registers that the numeric value changes on http but it doesn’t get sent back to imp

can anyone help please