I am trying to get the IP address and send it to my rails server as a parameter of a POST request. Is this action safe?

  • 4
    more context...what is the IP address for? I dont see why it would be unsafe, if you are unsure just send it via https?
    – TheHidden
    Commented Nov 3, 2016 at 22:37
  • it depends on what you then want to do with that address (and also what address it is), so yeah, much more details are needed Commented Nov 3, 2016 at 22:40
  • Im sending the IP Address of a mobile device to the rails server. Not sure if it is a secure practice?
    – cengo
    Commented Nov 3, 2016 at 22:41
  • 2
    can you elaborate what you want to achieve by this? Commented Nov 3, 2016 at 23:36
  • Safe against what?
    – Marcel
    Commented Nov 4, 2016 at 7:06

2 Answers 2


There's no utility on sending IP address of local device, on which you app is running. There're good chances that you'll get only local ip-address from the device, which is hardly useful. Moreover, in the days of dynamic public IP address assignment from ISPs, IP addresses are hardly used for monitoring or tracking purpose(As there're good chances that public IP address assigned to you by your ISP, may be assigned to some other computer, at another time).


To ensure that the data is 'safely' POSTed to your server such that it remains confidential and is not tampered with by an attacker in transit, use transport layer security (TLS).

To ensure that your application 'safely' processes the POSTed data, validate that data prior to use to ensure it is what you expect to receive i.e an IP Address.

Not the answer you're looking for? Browse other questions tagged .