Thanks for your msg 7imon7ays, it works also without the port.
It turns out that I got messed up with the LatLng Objects. The way I figured it out was, this:
Since "https://api.uber.com/v1/estimates/price" is a GET I tested this url on a browser:
"https://api.uber.com/v1/estimates/price?start_latitude=37.625732&start_longitude=-122.377807&end_latitude=37.785114&end_longitude=-122.406677&server_token=xxxxxxx"
(replace xxxxxx with your server_token)...
And it worked!, I was able to see the output as expected, so digging deeper, I added a console.log(uberParams) <- to my uberParams, and it turns out that all of them but the key were undefined:
This is what I was using: (Wrong)
var uberParams = {
start_latitude : origin.latitude,
start_longitude : origin.longitude,
end_latitude: destination.latitude,
end_longitude: destination.longitude,
server_token:"xxxxxxx"
}
Where origin and destination are both google.maps.LatLng Objects.
So, for the API, I was incorrectly sending this:
{
start_latitude : undefined,
start_longitude : undefined,
end_latitude: undefined,
end_longitude: undefined,
server_token:"xxxxxxx"
}
And the UBER Api, was returning THIS ERROR: -> Access-Control-Allow-Origin
That caused the confusion, because the origin_uri wasn't the problem, as soon as I changed the params to this:
var uberParams = {
start_latitude : origin.lat(),
start_longitude : origin.lng(),
end_latitude: destination.lat(),
end_longitude: destination.lng(),
server_token:"xxxxxxx"
}
Everything worked as expected.
A Note to my Uber Friends: "Great API, poor Error handling and descriptions..."