1

I have a fairly straightforward PHP application that is using a library to connect to a REST API and poll information. I was racking my brain trying to figure out why the calls were failing when I was testing it locally via MAMP. As a last ditch effort, I uploaded it to my web server and hit it from my browser and, lo and behold, it worked just fine.

Why would the script not work locally? Is there something about making REST calls via MAMP that just doesn't work?

I'm confused.

Frank Caron
  • 324
  • 2
  • 11

1 Answers1

0

Well actually some services just do not accept calls made from your localhost. It may be completely impossible or if the API you are using requires some settings you will have probably to specify that you are working on localhost.

Similar issue here, but with the Facebook API:

How can I make Facebook's graph API work on my localhost?

Community
  • 1
  • 1