Send data to another imp

hello there, i have almost what i want with a minor issue. here is the code:
`//send data to a specific imp
function send_to_imp(imp_url="", imp_f="", imp_v="")
{
server.log(“SEND TO IMP : " + imp_url + " | FIELD:” + imp_f + " | VALUE: " + imp_v); // body for testing
data <- { imp_f = imp_v };
http.post(imp_url, {}, http.jsonencode(data)).sendasync(function(res) {
if (res.statuscode != 200) {
server.error("IMP SEND FAILED: " + res.statuscode + " => " + res.body);
}
})
}

send_to_imp(“https://agent.electricimp.com/*************”, “field_1” , “ON”);

device.on(“send_to_imp”, function(data)
{
//take from device
send_to_imp(data.imp_url, data.imp_field, data.imp_value); //send to function to imp
});
`

When i send this, it works but on the other side i receive
imp_f = ON

but i wanted
field_1 = ON

any suggestions??? thanks

the part on the code :
send_to_imp(“https://agent.electricimp.com/*************”, “field_1” , “ON”);

is done for test purposes.

Where your code has:
data <- { imp_f = imp_v };
that should be:

`local data = {};
data[imp_f] <- imp_v;
`

Peter

oh i see. Thanks peter i will give it a try!