I'm trying to create a RESTful API and document. However I seem to be getting a weird error I can't figure out how to fix.
This works:
curl --header "Accept: application/json" http://api.example.com/v1/method.php?key=test
However if you remove the ".php" extension and run this:
curl --header "Accept: application/json" http://api.example.com/v1/method?key=test
You should get a 406 error if you run it. Now if you drop the header that the curl is sending, both of the requests work just fine. However the documentation tool(swagger) I'm using requires it.
Here is my rewrite rule (found here):
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]