We created PHP-based plugin that provides a RESTful interface that is used by a mobile app that we are working on. The plugin is self-hosted, meaning anyone who wants to use the mobile app has to install this PHP plugin on their server. One of our users is reporting that after installing the plugin they fail to login. Using Postman to exercise the APIs involved in the login request, I came up with the following:
REQUEST
PUT http://<user's website>/index.php/wurrd/clientinterface/operator/login
{"username":"apple", "password":"dove", "clientid":"AABBB-CCCCC-DEFGHIJ", "deviceuuid":"aaa-uuu-isdi"}
RESPONSE
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
<title>501 Method Not Implemented</title>
</head>
<body>
<h1>Method Not Implemented</h1>
<p>GET to /chat/index.php/wurrd/clientinterface/operator/login not supported.
<br />
</p>
<p>Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.</p>
</body>
</html>
The API doesn't expose that route for a GET, so the error message is appropriate when trying to get there via a GET. However, the issue is that the request was made with a PUT.
I am at a loss as to how to investigate the issue. The server is running Apache. Could it be a problem with the .htaccess? I thought may be a mod_rewrite issue, but I guess this should deal with the URL and not the HTTP method.
Also, routing is done using the Symfony2 routing component.
Any help would be appreciated.
Thanks.
Update 1:
This is the configuration of the Symfony route:
wurrd_client_operator_login:
# The login request details are passed in as a JSON payload.
path: /wurrd/clientinterface/operator/login
defaults:
_controller: Wurrd\Mibew\Plugin\ClientInterface\Controller\OperatorController::loginAction
methods: [PUT]