Fetching data works with ip address but not with localhost

Because localhost is what is most documentation is using, the IP is different they could have said X.x.x.x but then that would have to be changed to. Most people just copy it instead of read it.