How Do I Use Restfull Webservices with Cakephp - cakephp

How do I use RESTfull Web services with Cakephp? I have already done 2 projects in cakephp, have a basic idea about the cakephp and its structure
Please advise me

To provide RESTful services, check out the RequestHandler component for your controllers and and parseExtensions in the router. There's a really good video on the CakePHP website that should get you started: http://tv.cakephp.org/video/CakeFoundation/2010/12/24/andrew_curioso_-_developing_an_api

Related

Best Practices For Django Web App + REST API Architecture as one project

I am working on my Django project which is going to be a Web App and REST Api for the mobile app.
I am using Django Rest Framework to build the API for the mobile app and it is going pretty good. I like it. For this part, I have a separate app within my Django project. Let's call it 'api'.
What I also want to do, is a web app. Let's call it 'webapp' in my Django project. So basically, web version of the mobile app, with a few different functionalities (e.g. different user/account management) for a slightly different part of the audience. Obviously, the majority of the models that I need, as well as logic are already there in the 'api' app. Also, I want to use Angularjs for the front end of the web app.
My question is what is the best path to take here? Should I create a separate app for my web app and copy the majority of views.py logic, which again will reference models and serializers from the 'api' app in the project? Or should I adjust my existing 'api' app to handle requests from both mobile phones and web app? Thank you.
You can follow link. I also follow that link when started angularjs, django and django-reset-framework.

Spring Security + Angular JS + Spring MVC Rest

I am trying to build a web application with the following frameworks:
Angular JS on the front end
REST Web Services in the backend using Spring MVC
I want to use Spring Security to authenticate all the requests going from Angular JS to Spring REST Web services. I also need to manage the session timeout/remember password etc. (All of the typical functionalities of a login functionality in a web app)
I have gone over hundreds of articles trying to find out how to do this but none of them is exactly serving the purpose I am asking for.
Any help on this (inline answer or external links) with detailed steps is highly appreciated.
(Note: I don't want to use Spring boot. Many tutorials including the one provided by Spring is using Spring boot.)
Finally found the way to do this. Clearly explained, step by step process to secure a Spring MVC based REST APIs using Spring Security
https://malalanayake.wordpress.com/2014/06/30/stateless-spring-security-on-rest-api/

Spring Security REST and Angular

I have a full Spring application (security managed by spring-security and the controller Layer is build with Spring MVC).
I am using in the front-end AngularJS .
I need some example of how I will handle REST authentication with Spring Security and how I will call these services in the Angular side.
Note: Basic authentication will be perfect in my case .
Some code is needed to integrate AngularJS and Spring Security, as Spring Security wasn't meant to be used by a full Ajax framework.
Here is a sample application that does this integration, you will get both the Spring Security configuration and some classes used to do this integration:
https://github.com/jhipster/jhipster-sample-app
One of the great things about AngularJS is that its pretty flexible and can operate with a number of different backend configurations. While I haven't personally used spring MVC or spring security I have used Angular with .NET MVC, Node, and PHP all with slightly different authentication systems and it worked out very well.
Dave Mosher has a great tutorial series that incorporates authentication concepts(his example is PHP with Laravel) but the concepts may be helpful:
https://github.com/davemo/end-to-end-with-angularjs
For a more advanced example of authentication with AngularJS you might want to check out Angular-App:
https://github.com/angular-app/angular-app

Building a Sencha based mobile app with a CakePHP backend

I am using Cakephp 2 as a backend for a cafe shop mobile application. I would like to use Sencha as the mobile framework.
I have the following questions:
Should I be building the frontend within the CakePHP framework as layouts/views or should I use CakePHP to create a RESTful webservice in order to access my data?
Can a complete cake application be wrapper using phonegap?
Thanks.
I would recommend building your mobile application separately from your Cake app. Like you mentioned, I would go with building a RESTful web service to provide your data. I would recommend using JSON, but that's your decision.
Cake provides built in support for building RESTful web services, but you probably knew this. :) http://book.cakephp.org/2.0/en/development/rest.html
A Cake application cannot be wrapped up inside PhoneGap since it needs to be run on a web server (Apache, IIS, etc)
There is also a framework which does a lot of work for you, it's specifically to integrate CakePHP with Sencha Touch http://banchaproject.org

Twitter Web service in Silverlight

I want to use twitter web service in my silverlight application but don't know where I can find skd and web service reference for the twitter ?
When using twitter API with silverlight or any .net client app, you cannot just add a service reference to the project. You have to hand code and make direct calls to each feature you require. You should go through the their API wiki here and a tutorial here.
If you want things done fast, use a library like tweetsharp.

Resources