How to use web service in cakephp

First you need to add the given below code in AppController.php

then the main important thing is render the page for response in json formate so create the page like ajax.ctp and paste the code and add in the view folder.

Then you can use the code on controller

I also use the url like prefix . Url/api/users/login

so you can go in config file and add the code

Check the app controller for RequestHandler

 

Share This:

Leave a Reply

Your email address will not be published. Required fields are marked *