Skip to main content
8 events
when toggle format what by license comment
Jul 16, 2018 at 6:32 comment added Edoardo @ZachLipton your view might be correct, though we were not asked to (re)design his whole API - OP wanted to know what code to use: I think a lot has being said and personally I Iike this answer that shows what kind of problems they are going to face if they proceed with IP geolocation and 1 possible (non perfect) alternative.
Jul 15, 2018 at 20:15 comment added Zach Lipton @eddyce I agree that using the client IP is a bad idea for many reasons. I'm saying that /API/Vienna/HailRide is also prone to problems, because it requires the client to convert locations into city names, and that's not a 1-to-1 mapping that corresponds with the areas a company does business.
Jul 15, 2018 at 20:00 comment added Edoardo @ZachLipton no, the point here is not having the service use client IP to understand the location, that is just wrong
Jul 14, 2018 at 20:34 comment added chrylis -cautiouslyoptimistic- As an alternative, 200 with an empty set of results (or 204).
Jul 14, 2018 at 8:37 comment added Bergi @ZachLipton I'm pretty sure the city names were an example only, it depends on the OP's actual business rules how they define "city" or "location". It could as well be a coordinate.
Jul 13, 2018 at 22:42 comment added Zach Lipton I have to disagree with this. Including the name of the city in the URL could lead to all sorts of problems down the road, because it forces the client to determine a city name based on the location, and you well may not like the result. For example, are you in Los Angeles or Beverly Hills? London or Westminster? What happens if the client thinks it's in Richardson, but you want an API to serve the entire Dallas area? It would be a better idea for the client to just supply the pickup/dropoff locations; the server can determine whether they're within the service area and respond accordingly.
Jul 13, 2018 at 9:18 comment added Edoardo This should be the accepted answer: API design is not only about complying with old numerical codes, and the scenario about vpn's etc is quite realistic.
Jul 12, 2018 at 20:11 history answered Heinzi CC BY-SA 4.0