0

I'm trying to integrate with an API that sends GET and POST requests to preset URLs. The urls are in the given format: http://example.com/api/X where X would change between different requests.

For instance: http://example.com/api/status , http://example.com/api/update etc...

I want to be able to receive the request via PHP and send a response, but since there is no filename defined at the end of the URL I don't understand how to do so. I can't use http://example.com/api/status/index.php , since this would return a 301 response.

How should I approach this?

Geva Tal
  • 240
  • 3
  • 13
  • 1
    mod rewrite rules. If you havent started yet save yourself some hassel and use a nice microframework that is set up for this kind of thing, like fatfreeframework or slim – Steve Nov 11 '14 at 16:43
  • Thanks. Will look into that. – Geva Tal Nov 11 '14 at 16:51

0 Answers0