Hi, I have a problem that keeps me from moving forward.
I have a Web Service in which it asks to enter coordinates (INPUT); these, if they are correct, will send in JSON
format a list of the name of the nearby branches (OUTPUT).
You can see it here:
The issue is that I could not manage to send the parameters to get this information ( lat
, long
) from FrontEnd.
Data:
-
Input:
lat
(float
): GPS latitudelong
(float
): GPS length -
Output:
List of companies and branches with the following parameters:
id_sucursal
,direccion
,nombre_empresa
,distancia
.Access: link
Code: I understand this, I know it is wrong and I would like if you can help me to correct and complete it, please, and I have seen too many videos, I have been able to achieve connection with a get, without sending parameters, as in the courses, but this nothing.
function comotellames($scope, $http) {
$http({
url: 'http://saltala.cl/igniter/Appmovil/GetSucursales',
method: "POST",
data:
latitud= ???
longitud= ??
headers: {'Content-Type': 'application/x-www-form-urlencoded'}
})
.success(function (data, status, headers, config) {
console.log(data)
id_sucursal, direccion, nombre_empresa, distancia. ??
}).error(function (data, status, headers, config) {
console.log(error),
$scope.status = status;
});