[Background Location Plugin] Not getting Lat/Lon values when doing HTTP post

[Background Location Plugin] Not getting Lat/Lon values when doing HTTP post

  
Forge Component
(4)
Published on 2017-11-27 by Alexandre Costa
4 votes
Published on 2017-11-27 by Alexandre Costa

Hi,

I'm using the 'url' parameter of the plugin to send data to the server with an HTTP post (REST web service created in OS) and then store the data.

I've edited the plugin to include the 'postTemplate' parameter in the options configuration:

postTemplate: {
            lat: '@latitude',
            lon: '@longitude',
            time: '@time',
            user: $parameters.user
}

I'm actually receiving data but only for the time variable, everything else is empty.

Has anyone successfully achieved sending information with an HTTP post using this component? Am I doing something wrong?

I was able to figure out what was wrong. It seems like the 'postTemplate' parameter is being ignored so I needed to use the plugin's variable names for latitude and longitude on the web service input parameter. I just changed the name of the attributes 'lat' and 'lon' to 'latitude' and 'longitude' and now I'm receiveing their values.