Restful Service Using Slim Framework
Restful Service Using Slim Framework
Want create site? With Free visual composer you can do it easy.

How to create a Restful Service using Slim Framework

REST stands for Representational State Transfer. Restful services are nothing but web services which are based on URIs to use resources. You can call data and functions which are added in the form of restful services from the restful glossary. In this tutorial we will see how to create a Restful Service using Slim Framework. Slim is very popular framework and light weight framework  especially used to create  Restful services. The following example demonstrates how to create functions and call those functions using route URLs.

RESTful service gives output mostly in the form of  JSON or  XML.

In this example, I am just using a table to get data as well as post data. There you have different type of

Follow the steps carefully to create restful service in Slim Framework.

  1.  Create a database in MYSQL and a table in it. Database and table names could be your choice.
  2. My table name here is scores which contains 3 fields named ScoreId, Name and Score. You can improve table as per your requirement.
  3. Now follow the code which contains 3 different methods to retrieve scores,  users (means players) and user for a particular player information.
  4. You need to change database username, passwords and table name accordingly in the given example.

Did you find apk for android? You can find new Free Android Games and apps.